Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ukstv committed May 30, 2024
1 parent e7419f4 commit 914e589
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/ancillary/multiprocess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MultiprocessOptions> = {
Expand Down Expand Up @@ -73,8 +78,6 @@ export class Multiprocess extends EventEmitter {
processes -= 1
cluster.fork()
}

options.main?.()
}

stop() {
Expand Down

0 comments on commit 914e589

Please sign in to comment.