Cluster | typescript
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

Worker

Worker: Worker

isMaster

isMaster: boolean

isWorker

isWorker: boolean

settings

settings: ClusterSettings

worker

worker: Worker

workers

workers: object

Type declaration

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string, listener: Function): this
  • addListener(event: "disconnect", listener: function): this
  • addListener(event: "exit", listener: function): this
  • addListener(event: "fork", listener: function): this
  • addListener(event: "listening", listener: function): this
  • addListener(event: "message", listener: function): this
  • addListener(event: "online", listener: function): this
  • addListener(event: "setup", listener: function): this
  • events.EventEmitter

    1. disconnect
    2. exit
    3. fork
    4. listening
    5. message
    6. online
    7. setup

    Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns this

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns this

disconnect

  • disconnect(callback?: Function): void
  • Parameters

    • Optional callback: Function

    Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "disconnect", listener: function): boolean
  • emit(event: "exit", listener: function): boolean
  • emit(event: "fork", listener: function): boolean
  • emit(event: "listening", listener: function): boolean
  • emit(event: "message", listener: function): boolean
  • emit(event: "online", listener: function): boolean
  • emit(event: "setup", listener: function): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns boolean

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns boolean

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns boolean

  • Parameters

    • event: "listening"
    • listener: function

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns boolean

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]

fork

  • Parameters

    • Optional env: any

    Returns Worker

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(type: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string, listener: Function): this
  • on(event: "disconnect", listener: function): this
  • on(event: "exit", listener: function): this
  • on(event: "fork", listener: function): this
  • on(event: "listening", listener: function): this
  • on(event: "message", listener: function): this
  • on(event: "online", listener: function): this
  • on(event: "setup", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns this

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns this

once

  • once(event: string, listener: Function): this
  • once(event: "disconnect", listener: function): this
  • once(event: "exit", listener: function): this
  • once(event: "fork", listener: function): this
  • once(event: "listening", listener: function): this
  • once(event: "message", listener: function): this
  • once(event: "online", listener: function): this
  • once(event: "setup", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns this

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns this

prependListener

  • prependListener(event: string, listener: Function): this
  • prependListener(event: "disconnect", listener: function): this
  • prependListener(event: "exit", listener: function): this
  • prependListener(event: "fork", listener: function): this
  • prependListener(event: "listening", listener: function): this
  • prependListener(event: "message", listener: function): this
  • prependListener(event: "online", listener: function): this
  • prependListener(event: "setup", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns this

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: Function): this
  • prependOnceListener(event: "disconnect", listener: function): this
  • prependOnceListener(event: "exit", listener: function): this
  • prependOnceListener(event: "fork", listener: function): this
  • prependOnceListener(event: "listening", listener: function): this
  • prependOnceListener(event: "message", listener: function): this
  • prependOnceListener(event: "online", listener: function): this
  • prependOnceListener(event: "setup", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "disconnect"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "exit"
    • listener: function
        • (worker: Worker, code: number, signal: string): void
        • Parameters

          • worker: Worker
          • code: number
          • signal: string

          Returns void

    Returns this

  • Parameters

    • event: "fork"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function

    Returns this

  • Parameters

    Returns this

  • Parameters

    • event: "online"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "setup"
    • listener: function
        • (settings: any): void
        • Parameters

          • settings: any

          Returns void

    Returns this

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: string | symbol, listener: Function): this

setMaxListeners

  • setMaxListeners(n: number): this

setupMaster

  • Parameters

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc