X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=660152cf364fb689eeeb6343af15677fd206c2a0;hb=2405d0fcd4939f801b544cefa8fd07b9ee2f0080;hp=affe8bc91ce03bc3ad3f6c71448203026ee40eaa;hpb=25926072f5397949802f6af5a2f7d49d6f15cacc;p=poolifier.git diff --git a/README.md b/README.md index affe8bc9..660152cf 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [![Code Coverage](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=coverage)](https://sonarcloud.io/dashboard?id=pioardi_poolifier) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=alert_status)](https://sonarcloud.io/dashboard?id=pioardi_poolifier) [![Javascript Standard Style Guide]()](https://standardjs.com) -[![Discord](https://badgen.net/discord/online-members/85VrP8m8?icon=discord&label=discord&color=green)](https://discord.gg/85VrP8m8) +[![Discord](https://badgen.net/discord/online-members/vXxZhyb3b6?icon=discord&label=discord&color=green)](https://discord.gg/vXxZhyb3b6) [![Open Collective](https://opencollective.com/poolifier/tiers/badge.svg)](https://opencollective.com/poolifier) [![PRs Welcome](https://badgen.net/static/PRs/welcome/green)](http://makeapullrequest.com) [![No Dependencies]()]() @@ -36,7 +36,7 @@ Please consult our [general guidelines](#general-guidelines). - Performance [benchmarks](./benchmarks/README.md) :white_check_mark: - No runtime dependencies :white_check_mark: - Proper integration with Node.js [async_hooks](https://nodejs.org/api/async_hooks.html) :white_check_mark: -- Support for CommonJS, ESM, and TypeScript :white_check_mark: +- Support for CommonJS, ESM and TypeScript :white_check_mark: - Support for [worker_threads](https://nodejs.org/api/worker_threads.html) and [cluster](https://nodejs.org/api/cluster.html) Node.js modules :white_check_mark: - Support for multiple task functions :white_check_mark: - Support for task functions [CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete) operations at runtime :white_check_mark: @@ -44,7 +44,7 @@ Please consult our [general guidelines](#general-guidelines). - Tasks distribution strategies :white_check_mark: - Lockless tasks queueing :white_check_mark: - Queued tasks rescheduling: - - Task stealing :white_check_mark: + - Task stealing on empty queue :white_check_mark: - Tasks stealing under back pressure :white_check_mark: - Tasks redistribution on worker error :white_check_mark: - General guidelines on pool choice :white_check_mark: @@ -116,8 +116,8 @@ 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')) +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 const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', { @@ -125,9 +125,9 @@ const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), avail onlineHandler: () => console.info('worker is online') }) -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')) +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, // so you can easily switch from one to another