From 914e589a4b66ab52a4e59bc5f9e31a5f26256cd6 Mon Sep 17 00:00:00 2001 From: Sergey Ukustov Date: Fri, 10 May 2024 18:20:52 +0300 Subject: [PATCH] doc --- src/ancillary/multiprocess.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ancillary/multiprocess.ts b/src/ancillary/multiprocess.ts index f1de77bc..68e38e2a 100644 --- a/src/ancillary/multiprocess.ts +++ b/src/ancillary/multiprocess.ts @@ -7,9 +7,14 @@ export type MultiprocessOptions = { * If `true`, a single worker failure should not kill us all. A failed worker will get respawned. */ keepAlive: boolean + /** + * If `true`, the workers are started right away. + */ autostart: boolean + /** + * Number of child processes to spawn. By default, number of child processes equals to number of CPUs. + */ workers: number | undefined - main: MultiprocessWork } const DEFAULT_OPTIONS: Partial = { @@ -73,8 +78,6 @@ export class Multiprocess extends EventEmitter { processes -= 1 cluster.fork() } - - options.main?.() } stop() {