X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fpool.ts;h=7bc8cf850b105983907d7b74cbab618121f8560b;hb=de868be6cc9bcfb6d341ffb14e6407c24a1a0e17;hp=b1b504d59b22bba2aca61becc898fa87167c5c6c;hpb=65542a35fd6759cddb82167dd4c47f9bed843ebf;p=poolifier.git diff --git a/src/pools/pool.ts b/src/pools/pool.ts index b1b504d5..7bc8cf85 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -1,5 +1,6 @@ -import type { TransferListItem } from 'node:worker_threads' +import type { TransferListItem, WorkerOptions } from 'node:worker_threads' import type { EventEmitterAsyncResource } from 'node:events' +import type { ClusterSettings } from 'node:cluster' import type { TaskFunction } from '../worker/task-functions' import type { ErrorHandler, @@ -189,6 +190,24 @@ export interface PoolOptions { * Pool worker node tasks queue options. */ tasksQueueOptions?: TasksQueueOptions + /** + * Worker options. + * + * @see https://nodejs.org/api/worker_threads.html#new-workerfilename-options + */ + workerOptions?: WorkerOptions + /** + * Key/value pairs to add to worker process environment. + * + * @see https://nodejs.org/api/cluster.html#cluster_cluster_fork_env + */ + env?: Record + /** + * Cluster settings. + * + * @see https://nodejs.org/api/cluster.html#cluster_cluster_settings + */ + settings?: ClusterSettings } /**