X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=e7b7a5d1f75a3ad6e90927ed1a2efe3441136a04;hb=9d96ba4ea0e2e4b06216657cb1641551b59f58ee;hp=170bd4f49e27eb845c49bbd1dfb32c87b9784cc2;hpb=1f3f7256283ff023bac9d1cd4ef3c58f05e9dd39;p=poolifier.git
diff --git a/README.md b/README.md
index 170bd4f4..e7b7a5d1 100644
--- a/README.md
+++ b/README.md
@@ -2,29 +2,25 @@
-
Node.js Worker_Threads and Cluster Worker Pool
+
+
+# Node.js Worker_Threads and Cluster Worker Pool
+
+
-
- ![GitHub commit activity (master)](https://img.shields.io/github/commit-activity/m/poolifier/poolifier/master?color=brightgreen&logo=github)
-
- ![Weekly Downloads](https://badgen.net/npm/dw/poolifier?icon=npm)
-
- ![Actions Status](https://github.com/poolifier/poolifier/actions/workflows/ci.yml/badge.svg)
-
- ![Code Coverage](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=coverage)
-
- ![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=alert_status)
-
- ![Javascript Standard Style Guide](https://badgen.net/static/code style/standard/green)
-
- ![Discord](https://badgen.net/discord/online-members/85VrP8m8?icon=discord&label=discord&color=green)
-
- ![Open Collective](https://opencollective.com/poolifier/tiers/badge.svg)
-
- ![PRs welcome](https://badgen.net/static/PRs/welcome/green)
-
- ![No dependencies](https://badgen.net/static/dependencies/no dependencies/green)
+
+[![GitHub commit activity (master)](https://img.shields.io/github/commit-activity/m/poolifier/poolifier/master?color=brightgreen&logo=github)](https://github.com/poolifier/poolifier/graphs/commit-activity)
+[![Weekly Downloads](https://badgen.net/npm/dw/poolifier?icon=npm)](https://www.npmjs.com/package/poolifier)
+[![CI Workflow](https://github.com/poolifier/poolifier/actions/workflows/ci.yml/badge.svg)](https://github.com/poolifier/poolifier/actions/workflows/ci.yml)
+[![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)
+[![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]()]()
+
## Why Poolifier?
@@ -48,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:
@@ -120,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', {
@@ -129,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