src/pools/selection-strategies/weighted-round-robin-choice-strategy.ts -> src/pools...
[poolifier.git] / src / pools / abstract-pool-worker.ts
1 import type {
2 ErrorHandler,
3 ExitHandler,
4 IPoolWorker,
5 MessageHandler,
6 OnlineHandler
7 } from './pool-worker'
8
9 /**
10 * Basic class that implement the minimum required for a pool worker.
11 */
12 export abstract class AbstractPoolWorker implements IPoolWorker {
13 /** @inheritDoc */
14 abstract on (event: 'message', handler: MessageHandler<this>): void
15 /** @inheritDoc */
16 abstract on (event: 'error', handler: ErrorHandler<this>): void
17 /** @inheritDoc */
18 abstract on (event: 'online', handler: OnlineHandler<this>): void
19 /** @inheritDoc */
20 abstract on (event: 'exit', handler: ExitHandler<this>): void
21 /** @inheritDoc */
22 abstract once (event: 'exit', handler: ExitHandler<this>): void
23 }