Classes

Worker

Interfaces

ClusterSettings

Properties

SP isMaster: boolean

Type:
  • boolean

SP isWorker: boolean

Type:
  • boolean

SP worker: cluster.Worker

SP workers: cluster.Worker[]

Type:

Methods

SM addListener(event: string, listener: function) void

Parameters:
Name Type
event string
listener function
Returns: { void }

SM disconnect(callback: function) void

Parameters:
Name Type Argument
callback function <optional>
Returns: { void }

SM emit(event: string, ...args: any) boolean

Parameters:
Name Type Argument
event string
...args any <repeatable>
Returns: { boolean }

SM fork(env: any) cluster.Worker

Parameters:
Name Type Argument
env any <optional>
Returns: { cluster.Worker }

SM listeners(event: string) function()[]

Parameters:
Name Type
event string
Returns: { Array.<function()> }

SM on(event: string, listener: function) any

Parameters:
Name Type
event string
listener function
Returns: { any }

SM once(event: string, listener: function) void

Parameters:
Name Type
event string
listener function
Returns: { void }

SM removeAllListeners(event: string) void

Parameters:
Name Type Argument
event string <optional>
Returns: { void }

SM removeListener(event: string, listener: function) void

Parameters:
Name Type
event string
listener function
Returns: { void }

SM setMaxListeners(n: number) void

Parameters:
Name Type
n number
Returns: { void }

SM setupMaster(settings: cluster.ClusterSettings) void

Parameters:
Name Type Argument
settings cluster.ClusterSettings <optional>
Returns: { void }