Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClusterManager

Hierarchy

  • EventSpewer
    • ClusterManager

Implements

  • EventEmitter

Index

Constructors

constructor

  • Parameters

    Returns ClusterManager

Properties

buckets

buckets: BaseCollection<number, Bucket> = new BaseCollection<number, Bucket>()

file

file: string

maxConcurrency

maxConcurrency: number = 1

processes

processes: BaseCollection<number, ClusterProcess> = new BaseCollection<number, ClusterProcess>()

ran

ran: boolean = false

respawn

respawn: boolean = true

rest

rest: DetritusRestClient

shardCount

shardCount: number = 0

shardEnd

shardEnd: number = -1

shardStart

shardStart: number = 0

shardsPerCluster

shardsPerCluster: number = 4

token

token: string

Accessors

clusterCount

  • get clusterCount(): number
  • Returns number

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

broadcast

  • broadcast(message: any): Promise<Array<any>>
  • Parameters

    • message: any

    Returns Promise<Array<any>>

broadcastEval

  • broadcastEval(code: Function | string, nonce?: string): Promise<Array<any>>
  • Parameters

    • code: Function | string
    • Default value nonce: string = Snowflake.generate().id

    Returns Promise<Array<any>>

broadcastEvalRaw

  • broadcastEvalRaw(code: Function | string, nonce?: string): Promise<Array<[any, boolean]>>
  • Parameters

    • code: Function | string
    • Default value nonce: string = Snowflake.generate().id

    Returns Promise<Array<[any, boolean]>>

emit

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

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

    Returns boolean

eventNames

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

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getRatelimitKey

  • getRatelimitKey(shardId: number): number
  • Parameters

    • shardId: 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: "clusterProcess", listener: function): this
  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

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

          Returns any

    Returns this

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

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