Generate documentation
[poolifier.git] / src / pools / abstract-pool-worker.ts
CommitLineData
bdaf31cd
JB
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 {
a76fac14 13 /** @inheritDoc */
bdaf31cd 14 abstract on (event: 'message', handler: MessageHandler<this>): void
a76fac14 15 /** @inheritDoc */
bdaf31cd 16 abstract on (event: 'error', handler: ErrorHandler<this>): void
a76fac14 17 /** @inheritDoc */
bdaf31cd 18 abstract on (event: 'online', handler: OnlineHandler<this>): void
a76fac14 19 /** @inheritDoc */
bdaf31cd 20 abstract on (event: 'exit', handler: ExitHandler<this>): void
a76fac14 21 /** @inheritDoc */
bdaf31cd
JB
22 abstract once (event: 'exit', handler: ExitHandler<this>): void
23}