The number of active workers in the pool.
Aborts all pending jobs and returns promise that is fulfilled when all workers are terminated.
This operation preserves the size of the pool intact.
Optional
reason: anyThe reason that is used to reject all pending job promises.
The promise that is fulfilled when all workers are terminated.
Changes the size of the pool by spawning or terminating workers. If the size of the pool is reduced, then corresponding workers are terminated and if they were processing jobs, those jobs are instantly aborted.
The new size of the pool.
Optional
reason: anyThe reason that is used to reject pending job promises that are processed by terminated workers. Only applicable if the pool is downsized.
The promise that is fulfilled when the number of workers matches the requested size: excessive workers were deleted or additional workers were spawned.
Submits a new callback that should be executed by the worker in the pool.
The callback to invoke.
The promise that is fulfilled with the callback result.
The callback execution pool that can execute limited number of callbacks in parallel while other submitted callbacks wait in the queue.