X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=e6d676ecdb28a27141de20c1ea08acfd4d064c7f;hb=47c9cec4c0a1a871153e1811ec6d95c90d2c86d1;hp=91112b67b071406e59e0fc8f04f814fd13e08454;hpb=31a7d5bea6971eff8079efd2a164a66086f6d4b3;p=poolifier.git diff --git a/README.md b/README.md index 91112b67..e6d676ec 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ ## Why Poolifier? -Poolifier is used to perform CPU intensive and I/O intensive tasks on nodejs servers, it implements worker pools using [worker-threads](https://nodejs.org/api/worker_threads.html#worker_threads_worker_threads) and cluster pools using [Node.js cluster](https://nodejs.org/api/cluster.html) modules. +Poolifier is used to perform CPU intensive and I/O intensive tasks on nodejs servers, it implements worker pools using [worker-threads](https://nodejs.org/api/worker_threads.html#worker_threads_worker_threads) and cluster pools using [cluster](https://nodejs.org/api/cluster.html) Node.js modules. With poolifier you can improve your **performance** and resolve problems related to the event loop. Moreover you can execute your tasks using an API designed to improve the **developer experience**. Please consult our [general guidelines](#general-guidance). @@ -122,6 +122,7 @@ const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', { onlineHandler: () => console.info('worker is online') }) +pool.emitter.on(PoolEvents.ready, () => console.info('Pool is ready')) pool.emitter.on(PoolEvents.busy, () => console.info('Pool is busy')) // or a dynamic worker-threads pool @@ -131,6 +132,7 @@ const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), avail }) pool.emitter.on(PoolEvents.full, () => console.info('Pool is full')) +pool.emitter.on(PoolEvents.ready, () => console.info('Pool is ready')) pool.emitter.on(PoolEvents.busy, () => console.info('Pool is busy')) // the execute method signature is the same for both implementations,