X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=10ee92c57876663d07ae96ecdcde036013395126;hb=cac70359b46b8437dd8d23ef6176c6cdfd187c0c;hp=e29c8c0faa1720af8c5c43bab67b5bc031a90251;hpb=c4855468bc26a7ee37d2c8ef34bb1ac864448e77;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index e29c8c0f..10ee92c5 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -32,7 +32,7 @@ export interface ClusterPoolOptions extends PoolOptions { * This pool selects the workers in a round robin fashion. * * @typeParam Data - Type of data sent to the worker. This can only be serializable data. - * @typeParam Response - Type of response of execution. This can only be serializable data. + * @typeParam Response - Type of execution response. This can only be serializable data. * @author [Christopher Quadflieg](https://github.com/Shinigami92) * @since 2.0.0 */ @@ -66,7 +66,7 @@ export class FixedClusterPool< } /** @inheritDoc */ - public destroyWorker (worker: Worker): void { + protected destroyWorker (worker: Worker): void { this.sendToWorker(worker, { kill: 1 }) worker.kill() } @@ -77,7 +77,7 @@ export class FixedClusterPool< } /** @inheritDoc */ - public registerWorkerMessageListener( + protected registerWorkerMessageListener( worker: Worker, listener: (message: MessageValue) => void ): void { @@ -101,12 +101,17 @@ export class FixedClusterPool< } /** @inheritDoc */ - public get full (): boolean { + public get size (): number { + return this.numberOfWorkers + } + + /** @inheritDoc */ + protected get full (): boolean { return this.workerNodes.length === this.numberOfWorkers } /** @inheritDoc */ - public get busy (): boolean { + protected get busy (): boolean { return this.internalBusy() } }