X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=db52c8c2c8ebb92fc50c2912a4875a6519750c99;hb=5b95eb9bcafda56ce57003da834cf4e153bb0509;hp=6f6e79c7cb91e089e1e3a8996446f58f38bffa82;hpb=8be1fc23a6f6accd14b9194293d82361e351d2f1;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'))