X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=a88197f715bdd2c2a129638d3960dce9d9ac8420;hb=75d3401a50550a9fc53e2e7d107bc2d776df83e3;hp=3f56c858b0ed5b363fc19da06eb1b9a295a66dd5;hpb=5b59d53ed7dd50ad5d42c0d5c146813e2c38132a;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 3f56c858..a88197f7 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -30,10 +30,8 @@ export interface ClusterPoolOptions extends PoolOptions { /** * A cluster pool with a fixed number of workers. * - * It is possible to perform tasks in sync or asynchronous mode as you prefer. - * - * @typeParam Data - Type of data sent to the worker. This can only be serializable data. - * @typeParam Response - Type of execution response. This can only be serializable data. + * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. + * @typeParam Response - Type of execution response. This can only be structured-cloneable data. * @author [Christopher Quadflieg](https://github.com/Shinigami92) * @since 2.0.0 */ @@ -80,25 +78,11 @@ export class FixedClusterPool< worker.send(message) } - /** @inheritDoc */ - protected registerWorkerMessageListener( - worker: Worker, - listener: (message: MessageValue) => void - ): void { - worker.on('message', listener) - } - /** @inheritDoc */ protected createWorker (): Worker { return cluster.fork(this.opts.env) } - /** @inheritDoc */ - protected afterWorkerSetup (worker: Worker): void { - // Listen to worker messages. - this.registerWorkerMessageListener(worker, super.workerListener()) - } - /** @inheritDoc */ protected get type (): PoolType { return PoolTypes.fixed