Fix WRR worker choice strategy implementation
[poolifier.git] / src / pools / abstract-pool-worker.ts
... / ...
CommitLineData
1import 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 */
12export 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}