X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Ffixed.ts;h=3dc10821e2cdb9198e3eea62e287a4fc4d8aa425;hb=f82cd3579677f83c17289218d4ae8242e7d0a8d7;hp=a95a86034fcf13abc471862bbe9d51d8aa4604d1;hpb=afc003b20097712625ffd053e256ef5336e27b6e;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index a95a8603..3dc10821 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -7,7 +7,7 @@ import { import type { Draft, MessageValue } from '../../utility-types' import { AbstractPool } from '../abstract-pool' import type { PoolOptions } from '../pool' -import { PoolType } from '../pool-internal' +import { PoolType } from '../pool' /** * A thread worker with message channels for communication between main thread and thread worker. @@ -22,7 +22,7 @@ export type ThreadWorkerWithMessageChannel = Worker & Draft * This pool selects the threads 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 [Alessandro Pio Ardizio](https://github.com/pioardi) * @since 0.0.1 */ @@ -51,7 +51,7 @@ export class FixedThreadPool< } /** @inheritDoc */ - public async destroyWorker ( + protected async destroyWorker ( worker: ThreadWorkerWithMessageChannel ): Promise { this.sendToWorker(worker, { kill: 1 }) @@ -67,7 +67,7 @@ export class FixedThreadPool< } /** @inheritDoc */ - public registerWorkerMessageListener( + protected registerWorkerMessageListener( messageChannel: ThreadWorkerWithMessageChannel, listener: (message: MessageValue) => void ): void { @@ -97,12 +97,12 @@ export class FixedThreadPool< } /** @inheritDoc */ - public get full (): boolean { - return this.workers.length === this.numberOfWorkers + protected get full (): boolean { + return this.workerNodes.length === this.numberOfWorkers } /** @inheritDoc */ - public get busy (): boolean { + protected get busy (): boolean { return this.internalBusy() } }