X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=07ca907620135eef6ed4d7124ec7a7df69704cf0;hb=6a3ecc500583fc68d5bbce89f8448ccd022ab900;hp=6f6e79c7cb91e089e1e3a8996446f58f38bffa82;hpb=8be1fc23a6f6accd14b9194293d82361e351d2f1;p=poolifier.git diff --git a/README.md b/README.md index 6f6e79c7..07ca9076 100644 --- a/README.md +++ b/README.md @@ -83,13 +83,13 @@ You have to implement your worker by extending the _ThreadWorker_ or _ClusterWor ## Installation -### npm +### npmjs ```shell npm install poolifier --save ``` -### jsr +### JSR ```shell npx jsr add @poolifier/poolifier @@ -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'))