-import type { Worker } from 'cluster'
+import type { ClusterSettings, Worker } from 'cluster'
import cluster from 'cluster'
import type { MessageValue } from '../../utility-types'
import { AbstractPool } from '../abstract-pool'
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
env?: any
+ /**
+ * Cluster settings.
+ *
+ * @see https://nodejs.org/api/cluster.html#cluster_cluster_settings
+ */
+ settings?: ClusterSettings
}
/**
*
* @param numberOfWorkers Number of workers for this pool.
* @param filePath Path to an implementation of a `ClusterWorker` file, which can be relative or absolute.
- * @param [opts={}] Options for this fixed cluster pool.
+ * @param opts Options for this fixed cluster pool.
*/
public constructor (
numberOfWorkers: number,
/** @inheritDoc */
protected setupHook (): void {
- cluster.setupPrimary({
- exec: this.filePath
- })
+ cluster.setupPrimary({ ...this.opts.settings, exec: this.filePath })
}
/** @inheritDoc */