X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fpool.ts;h=89559d2c9a1bf0e6694709d3908a0263af0c448e;hb=70353024c44987c467dadcec306c699ce4ae1f06;hp=14b30812d14bd21e55c0af4aee77db5daf8bc7e4;hpb=48ce047aceb6831be7bc8bcb9255a56e110e4dd5;p=poolifier.git diff --git a/src/pools/pool.ts b/src/pools/pool.ts index 14b30812..89559d2c 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -39,7 +39,8 @@ export class PoolEmitter extends EventEmitterAsyncResource {} */ export const PoolEvents = Object.freeze({ full: 'full', - busy: 'busy' + busy: 'busy', + error: 'error' } as const) /** @@ -91,6 +92,10 @@ export interface PoolOptions { * The worker choice strategy options. */ workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions + /** + * Restart worker on error. + */ + restartWorkerOnError?: boolean /** * Pool events emission. * @@ -142,6 +147,7 @@ export interface IPool< * * - `'full'`: Emitted when the pool is dynamic and full. * - `'busy'`: Emitted when the pool is busy. + * - `'error'`: Emitted when an error occurs. */ readonly emitter?: PoolEmitter /**