X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;fp=README.md;h=843eab8cc61ca132d9b9441ca516c11dc7659c54;hb=cb9249cf1a1433ed24abac37187cca3de6a9d012;hp=8cea8d6279757d3d9cbc75fa715a3341df1171bd;hpb=fd7f20bfaf7b7c9ceeb3415ed28589c96a8cf081;p=poolifier.git diff --git a/README.md b/README.md index 8cea8d62..843eab8c 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ import { DynamicThreadPool, FixedThreadPool, PoolEvents, availableParallelism } // 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') }) @@ -119,7 +119,7 @@ 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), + errorHandler: e => console.error(e), onlineHandler: () => console.info('worker is online') }) @@ -131,10 +131,10 @@ pool.emitter?.on(PoolEvents.busy, () => console.info('Pool is busy')) // so you can easily switch from one to another pool .execute() - .then((res) => { + .then(res => { console.info(res) }) - .catch((err) => { + .catch(err => { console.error(err) }) ```