X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=db52c8c2c8ebb92fc50c2912a4875a6519750c99;hb=dca3cdd3fe9277840f5a37e4ecc900718f7c1c52;hp=6f6e79c7cb91e089e1e3a8996446f58f38bffa82;hpb=b7bb85861ee98ae26b7177b0cb4be614770c60ab;p=poolifier.git diff --git a/README.md b/README.md index 6f6e79c7..db52c8c2 100644 --- a/README.md +++ b/README.md @@ -120,8 +120,8 @@ import { DynamicThreadPool, FixedThreadPool, PoolEvents, availableParallelism } // a fixed worker_threads pool const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', { - errorHandler: e => console.error(e), - onlineHandler: () => console.info('worker is online') + onlineHandler: () => console.info('worker is online'), + errorHandler: e => console.error(e) }) pool.emitter?.on(PoolEvents.ready, () => console.info('Pool is ready')) @@ -129,8 +129,8 @@ pool.emitter?.on(PoolEvents.busy, () => console.info('Pool is busy')) // or a dynamic worker_threads pool const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', { - errorHandler: e => console.error(e), - onlineHandler: () => console.info('worker is online') + onlineHandler: () => console.info('worker is online'), + errorHandler: e => console.error(e) }) pool.emitter?.on(PoolEvents.full, () => console.info('Pool is full'))