X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fapi.md;h=4a0a3eb253b1bc5159b6fffb1ccdfee381c7d629;hb=90a437103dd496c664770296b153cd145ec834a4;hp=f9af05a73780e225d50f0b97ebbbca4f35a433c3;hpb=af98b972cd1f5145852682b8167e4af0ff994260;p=poolifier.git diff --git a/docs/api.md b/docs/api.md index f9af05a7..4a0a3eb2 100644 --- a/docs/api.md +++ b/docs/api.md @@ -41,9 +41,9 @@ ### `pool.execute(data, name, transferList)` -`data` (optional) An object that you want to pass to your worker implementation. +`data` (optional) An object that you want to pass to your worker task function implementation. `name` (optional) A string with the task function name that you want to execute on the worker. Default: `'default'` -`transferList` (optional) An array of transferable objects that you want to transfer to your [worker_threads](https://nodejs.org/api/worker_threads.html) worker implementation. +`transferList` (optional) An array of transferable objects that you want to transfer to your [`ThreadWorker`](#class-yourworker-extends-threadworkerclusterworker) worker implementation. This method is available on both pool implementations and returns a promise with the task function execution response. @@ -113,7 +113,7 @@ An object with these properties: - `workerChoiceStrategyOptions` (optional) - The worker choice strategy options object to use in this pool. Properties: - - `retries` (optional) - The number of retries to perform if no worker is eligible. + - `retries` (optional) - The number of retries to perform if no worker is eligible. `Infinity` means infinite retries. - `measurement` (optional) - The measurement to use in worker choice strategies: `runTime`, `waitTime` or `elu`. - `runTime` (optional) - Use the tasks [simple moving median](./worker-choice-strategies.md#simple-moving-median) runtime instead of the tasks simple moving average runtime in worker choice strategies. - `waitTime` (optional) - Use the tasks [simple moving median](./worker-choice-strategies.md#simple-moving-median) wait time instead of the tasks simple moving average wait time in worker choice strategies. @@ -136,7 +136,7 @@ An object with these properties: - `size` (optional) - The maximum number of tasks that can be queued on a worker before flagging it as back pressured. It must be a positive integer. - `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. It must be a positive integer. - - `taskStealing` (optional) - Task stealing enablement on empty queue. + - `taskStealing` (optional) - Task stealing enablement on idle. - `tasksStealingOnBackPressure` (optional) - Tasks stealing enablement under back pressure. Default: `{ size: (pool maximum size)^2, concurrency: 1, taskStealing: true, tasksStealingOnBackPressure: true }`