Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
+.nyc_output/
+benchmarks/internal/results/
+coverage/
+docs/**/*.html
+docs/**/*.css
+docs/**/*.js
+lib/
+outputs/
--- /dev/null
+{
+ "$schema": "https://json.schemastore.org/prettierrc",
+ "semi": false,
+ "singleQuote": true,
+ "trailingComma": "none"
+}
-const DynamicThreadPool = require("poolifier/lib/dynamic");
+const DynamicThreadPool = require('poolifier/lib/dynamic')
-const { DynamicThreadPool } = require("poolifier/lib/dynamic");
+const { DynamicThreadPool } = require('poolifier/lib/dynamic')
```
But you should always prefer just using
```js
```
But you should always prefer just using
```js
-const { DynamicThreadPool } = require("poolifier");
+const { DynamicThreadPool } = require('poolifier')
```
#### New type definitions for input data and response
```
#### New type definitions for input data and response
// a fixed worker_threads pool
const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', {
// a fixed worker_threads pool
const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', {
- errorHandler: e => console.error(e),
+ errorHandler: (e) => console.error(e),
onlineHandler: () => console.info('worker is online')
})
onlineHandler: () => console.info('worker is online')
})
// or a dynamic worker_threads pool
const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', {
// or a dynamic worker_threads pool
const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', {
- errorHandler: e => console.error(e),
+ errorHandler: (e) => console.error(e),
onlineHandler: () => console.info('worker is online')
})
onlineHandler: () => console.info('worker is online')
})
// so you can easy switch from one to another
pool
.execute()
// so you can easy switch from one to another
pool
.execute()
console.error(err)
})
```
console.error(err)
})
```