From: Alessandro Pio Ardizio Date: Thu, 21 May 2020 07:51:34 +0000 (+0200) Subject: Update README.MD X-Git-Tag: 1.1.0~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=eba173044e1f2a4440400b2aad3e6789363f3ac4;p=poolifier.git Update README.MD --- 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.