X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fthread%2Ffixed.ts;h=c4256bf3b2213d8d7a6a60d7df8a95447576b888;hb=e44639e9af74427b71f1556ff7ec9f7606373e0d;hp=088d72c920092cb8637b5f86edbdedf62432f672;hpb=9d9fb7b64a28d150583fe1bcd895893f6736d9d4;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 088d72c9..c4256bf3 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -1,14 +1,13 @@ import { - type MessageChannel, type MessagePort, type TransferListItem, type Worker, isMainThread } from 'node:worker_threads' -import type { MessageValue } from '../../utility-types' -import { AbstractPool } from '../abstract-pool' -import { type PoolOptions, type PoolType, PoolTypes } from '../pool' -import { type WorkerType, WorkerTypes } from '../worker' +import type { MessageValue } from '../../utility-types.js' +import { AbstractPool } from '../abstract-pool.js' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool.js' +import { type WorkerType, WorkerTypes } from '../worker.js' /** * Options for a poolifier thread pool. @@ -63,8 +62,8 @@ export class FixedThreadPool< /** @inheritDoc */ protected sendStartupMessageToWorker (workerNodeKey: number): void { const workerNode = this.workerNodes[workerNodeKey] - const port2: MessagePort = (workerNode.messageChannel as MessageChannel) - .port2 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const port2: MessagePort = workerNode.messageChannel!.port2 workerNode.worker.postMessage( { ready: false, @@ -113,6 +112,11 @@ export class FixedThreadPool< return false } + /** @inheritDoc */ + protected checkAndEmitDynamicWorkerCreationEvents (): void { + /* noop */ + } + /** @inheritDoc */ protected get type (): PoolType { return PoolTypes.fixed