Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClusterProcess

Hierarchy

  • EventSpewer
    • ClusterProcess

Implements

  • EventEmitter

Index

Constructors

constructor

Properties

_evalsWaiting

_evalsWaiting: BaseCollection<string, object> = new BaseCollection<string, {promise: Promise<any>,resolve: Function,reject: Function,}>()

_shardsWaiting

_shardsWaiting: BaseCollection<number, object> = new BaseCollection<number, {resolve: Function, reject: Function}>()

clusterId

clusterId: number = -1

env

env: object

Type declaration

  • [key: string]: string | undefined

manager

process

process: ChildProcess | null = null

Accessors

file

  • get file(): string
  • Returns string

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

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

    Returns boolean

eval

  • eval(code: Function | string, nonce: string): Promise<[any, boolean] | null>
  • Parameters

    • code: Function | string
    • nonce: string

    Returns Promise<[any, boolean] | null>

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

hasEventListener

  • hasEventListener(name: string | symbol): boolean
  • Parameters

    • name: string | symbol

    Returns boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • on(event: "ready", listener: function): this
  • on(event: "shardClose", listener: function): this
  • on(event: "shardState", listener: function): this
  • on(event: "warn", listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "ready"
    • listener: function
        • (): any
        • Returns any

    Returns this

  • Parameters

    • event: "shardClose"
    • listener: function
        • Parameters

          Returns any

    Returns this

  • Parameters

    • event: "shardState"
    • listener: function

    Returns this

  • Parameters

    • event: "warn"
    • listener: function
        • (payload: object): any
        • Parameters

          • payload: object
            • error: Error

          Returns any

    Returns this

onExit

  • onExit(code: number, signal: string): Promise<void>
  • Parameters

    • code: number
    • signal: string

    Returns Promise<void>

onMessage

  • onMessage(message: IPCMessage | any): Promise<void>
  • Parameters

    Returns Promise<void>

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

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

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(name?: string | symbol): this
  • Parameters

    • Optional name: string | symbol

    Returns this

removeAllSubscriptions

  • removeAllSubscriptions(): this
  • Returns this

removeListener

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

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

removeSubscription

  • removeSubscription(subscription: EventSubscription): void
  • Parameters

    • subscription: EventSubscription

    Returns void

run

  • Parameters

    Returns Promise<ChildProcess>

send

  • send(message: any): Promise<void>
  • Parameters

    • message: any

    Returns Promise<void>

sendIPC

  • sendIPC(op: number, data?: any, request?: boolean, shard?: undefined | number): Promise<void>
  • Parameters

    • op: number
    • Default value data: any = null
    • Default value request: boolean = false
    • Optional shard: undefined | number

    Returns Promise<void>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

subscribe

  • subscribe(name: string | symbol, listener: function): EventSubscription
  • Parameters

    • name: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventSubscription

Generated using TypeDoc