From eba173044e1f2a4440400b2aad3e6789363f3ac4 Mon Sep 17 00:00:00 2001 From: Alessandro Pio Ardizio Date: Thu, 21 May 2020 09:51:34 +0200 Subject: [PATCH] Update README.MD --- README.MD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.MD b/README.MD index ca3d51b7..c9908435 100644 --- a/README.MD +++ b/README.MD @@ -56,7 +56,7 @@ function yourFunction (data) { return { ok: 1 } } -module.exports = new ThreadWorker(yourFunction, { maxInactiveTime: 60000 }) +module.exports = new ThreadWorker(yourFunction, { maxInactiveTime: 60000, async: false }) ``` Instantiate your pool based on your needed : @@ -121,6 +121,7 @@ This method will call the terminate method on each worker. `fn` (mandatory) The function that you want to execute on the worker thread
`opts` (optional) An object with these properties : - `maxInactiveTime` - Max time to wait tasks to work on ( in ms) , after this period the new worker threads will die. +- `async` - true/false , true if your function contains async pieces else false

Choose your pool

Performance is one of the main target of these thread pool implementations, we want to have a strong focus on this.
-- 2.34.1