Skip to content

Commit 295e106

Browse files
committed
docs: refine code documentation
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
1 parent 96c2699 commit 295e106

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

.github/workflows/combine-prs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Combine PRs
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 2 * * *'
6+
- cron: '0 1 * * *'
77

88
permissions:
99
contents: write

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
[![Javascript Standard Style Guide](<https://badgen.net/static/code style/standard/green>)](https://standardjs.com)
2222
[![Discord](https://badgen.net/discord/online-members/vXxZhyb3b6?icon=discord&label=discord&color=green)](https://discord.gg/vXxZhyb3b6)
2323
[![Open Collective](https://opencollective.com/poolifier/tiers/badge.svg)](https://opencollective.com/poolifier)
24-
[![PRs Welcome](https://badgen.net/static/PRs/welcome/green)](http://makeapullrequest.com)
24+
[![PRs Welcome](https://badgen.net/static/PRs/welcome/green)](https://makeapullrequest.com)
2525
[![No Dependencies](<https://badgen.net/static/dependencies/no dependencies/green>)](https://badgen.net/static/dependencies/nodependencies/green)
2626

2727
</div>
@@ -38,34 +38,34 @@ Moreover you can execute your tasks using an API designed to improve the
3838
**developer experience**.\
3939
Please consult our [general guidelines](#general-guidelines).
4040

41-
- Easy to use :white_check_mark:
42-
- Fixed and dynamic pool size :white_check_mark:
43-
- Easy switch from a pool type to another :white_check_mark:
44-
- Performance [benchmarks](./benchmarks/README.md) :white_check_mark:
45-
- No runtime dependencies :white_check_mark:
41+
- Easy to use
42+
- Fixed and dynamic pool size
43+
- Easy switch from a pool type to another
44+
- Performance [benchmarks](./benchmarks/README.md)
45+
- No runtime dependencies
4646

4747
<!-- - Proper integration with Deno
48-
[async_hooks](https://nodejs.org/api/async_hooks.html) :white_check_mark: -->
48+
[async_hooks](https://nodejs.org/api/async_hooks.html) -->
4949

50-
- Support for ESM and TypeScript :white_check_mark:
50+
- Support for ESM and TypeScript
5151
- Support for
5252
[web worker API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API)
53-
Deno module :white_check_mark:
54-
- Support for multiple task functions :white_check_mark:
53+
Deno module
54+
- Support for multiple task functions
5555
- Support for task functions
5656
[CRUD](https://en.wikipedia.org/wiki/Create,_read,_update_and_delete)
57-
operations at runtime :white_check_mark:
58-
- Support for sync and async task functions :white_check_mark:
59-
- Tasks distribution strategies :white_check_mark:
60-
- Lockless tasks queueing :white_check_mark:
57+
operations at runtime
58+
- Support for sync and async task functions
59+
- Tasks distribution strategies
60+
- Lockless tasks queueing
6161
- Queued tasks rescheduling:
62-
- Task stealing on empty queue :white_check_mark:
63-
- Tasks stealing under back pressure :white_check_mark:
64-
- Tasks redistribution on worker error :white_check_mark:
65-
- General guidelines on pool choice :white_check_mark:
66-
- Error handling out of the box :white_check_mark:
67-
- Widely tested :white_check_mark:
68-
- Active community :white_check_mark:
62+
- Task stealing on empty queue
63+
- Tasks stealing under back pressure
64+
- Tasks redistribution on worker error
65+
- General guidelines on pool choice
66+
- Error handling out of the box
67+
- Widely tested
68+
- Active community
6969

7070
<!-- - Code quality [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=bugs)](https://sonarcloud.io/dashboard?id=pioardi_poolifier)
7171
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=pioardi_poolifier&metric=code_smells)](https://sonarcloud.io/dashboard?id=pioardi_poolifier)

benchmarks/benchmarks-utils.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const runPoolifierPoolBenchmark = async (
160160
})
161161
}
162162

163-
export const LIST_FORMATTER = new Intl.ListFormat('en-US', {
163+
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
164164
style: 'long',
165165
type: 'conjunction',
166166
})

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ An object with these properties:
207207

208208
- `workerOptions` (optional) - An object with the worker options to pass to
209209
worker. See
210-
[worker_threads](https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options)
210+
[web worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#options)
211211
for more details.
212212

213213
## Worker

src/pools/abstract-pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export abstract class AbstractPool<
490490
* Checks if the worker id sent in the received message from a worker is valid.
491491
*
492492
* @param message - The received message.
493-
* @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker id is invalid.
493+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} If the worker id is invalid.
494494
*/
495495
private checkMessageWorkerId(message: MessageValue<Data | Response>): void {
496496
if (message.workerId == null) {
@@ -1604,7 +1604,7 @@ export abstract class AbstractPool<
16041604
*
16051605
* @param worker - The worker.
16061606
* @returns The added worker node key.
1607-
* @throws {@link https://nodejs.org/api/errors.html#class-error} If the added worker node is not found.
1607+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} If the added worker node is not found.
16081608
*/
16091609
private addWorkerNode(worker: Worker): number {
16101610
const workerNode = new WorkerNode<Worker, Data>(

src/pools/pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ export interface IPool<
260260
* @param name - The name of the task function.
261261
* @param fn - The task function.
262262
* @returns `true` if the task function was added, `false` otherwise.
263-
* @throws {@link https://nodejs.org/api/errors.html#class-typeerror} If the `name` parameter is not a string or an empty string.
264-
* @throws {@link https://nodejs.org/api/errors.html#class-typeerror} If the `fn` parameter is not a function.
263+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError} If the `name` parameter is not a string or an empty string.
264+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError} If the `fn` parameter is not a function.
265265
*/
266266
readonly addTaskFunction: (
267267
name: string,

src/pools/selection-strategies/worker-choice-strategy-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export class WorkerChoiceStrategyContext<
170170
* Executes the worker choice strategy in the context algorithm.
171171
*
172172
* @returns The key of the worker node.
173-
* @throws {@link https://nodejs.org/api/errors.html#class-error} If after configured retries the worker node key is null or undefined .
173+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} If after configured retries the worker node key is null or undefined .
174174
*/
175175
public execute(): number {
176176
const workerNodeKey = (

src/pools/thread/fixed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface ThreadPoolOptions<Data = unknown> extends PoolOptions<Data> {
1010
/**
1111
* Worker options.
1212
*
13-
* @see https://nodejs.org/api/worker_threads.html#new-workerfilename-options
13+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker#options
1414
*/
1515
workerOptions?: WorkerOptions
1616
}

src/worker/abstract-worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export abstract class AbstractWorker<
395395
* Check if the message worker id is set and matches the worker id.
396396
*
397397
* @param message - The message to check.
398-
* @throws {@link https://nodejs.org/api/errors.html#class-error} If the message worker id is not set or does not match the worker id.
398+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} If the message worker id is not set or does not match the worker id.
399399
*/
400400
private checkMessageWorkerId(message: MessageValue<Data>): void {
401401
if (message.workerId == null) {
@@ -444,7 +444,7 @@ export abstract class AbstractWorker<
444444
* Returns the main worker.
445445
*
446446
* @returns Reference to the main worker.
447-
* @throws {@link https://nodejs.org/api/errors.html#class-error} If the main worker is not set.
447+
* @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} If the main worker is not set.
448448
*/
449449
protected getMainWorker(): MainWorker {
450450
if (this.mainWorker == null) {

0 commit comments

Comments
 (0)