X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=9d162d8983a7bdce2a68b19e040392be40e83cd4;hb=4f4ae1cb3c33228a023ea599c2648268d15e6c0f;hp=95ea82b9697a12758a8118dc3ec0c308d8893427;hpb=35cf1c03f8379b58e410cad57189912379ee7b36;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 95ea82b9..9d162d89 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,4 +1,5 @@ -import { fork, isMaster, setupMaster, Worker } from 'cluster' +import type { Worker } from 'cluster' +import cluster from 'cluster' import type { MessageValue } from '../../utility-types' import type { PoolOptions } from '../abstract-pool' import { AbstractPool } from '../abstract-pool' @@ -50,14 +51,14 @@ export class FixedClusterPool< /** @inheritdoc */ protected setupHook (): void { - setupMaster({ + cluster.setupPrimary({ exec: this.filePath }) } /** @inheritdoc */ protected isMain (): boolean { - return isMaster + return cluster.isPrimary } /** @inheritdoc */ @@ -81,7 +82,7 @@ export class FixedClusterPool< /** @inheritdoc */ protected createWorker (): Worker { - return fork(this.opts.env) + return cluster.fork(this.opts.env) } /** @inheritdoc */