Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShardManager

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly [Symbol.toStringTag]

[Symbol.toStringTag]: string

baseObject

baseObject: new (...args: any[]) => Shard

Type declaration

    • new (...args: any[]): Shard
    • Parameters

      • Rest ...args: any[]

      Returns Shard

connectQueue

connectQueue: Shard[]

connectTimeout

connectTimeout: null | Timer

lastConnect

lastConnect: number

Optional limit

limit: number

Readonly size

size: number

Static Readonly [Symbol.species]

[Symbol.species]: MapConstructor

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<[string | number, Shard]>
  • Returns an iterable of entries in the map.

    Returns IterableIterator<[string | number, Shard]>

add

  • add(obj: Shard, extra?: unknown, replace?: boolean): Shard
  • Parameters

    • obj: Shard
    • Optional extra: unknown
    • Optional replace: boolean

    Returns Shard

clear

  • clear(): void
  • Returns void

connect

  • connect(shard: Shard): void
  • Parameters

    Returns void

delete

  • delete(key: string | number): boolean
  • Parameters

    • key: string | number

    Returns boolean

entries

  • entries(): IterableIterator<[string | number, Shard]>
  • Returns an iterable of key, value pairs for every entry in the map.

    Returns IterableIterator<[string | number, Shard]>

every

  • every(func: (i: Shard) => boolean): boolean
  • Parameters

    • func: (i: Shard) => boolean
        • Parameters

          Returns boolean

    Returns boolean

filter

  • Parameters

    • func: (i: Shard) => boolean
        • Parameters

          Returns boolean

    Returns Shard[]

find

  • find(func: (i: Shard) => boolean): undefined | Shard
  • Parameters

    • func: (i: Shard) => boolean
        • Parameters

          Returns boolean

    Returns undefined | Shard

forEach

  • forEach(callbackfn: (value: Shard, key: string | number, map: Map<string | number, Shard>) => void, thisArg?: any): void
  • Parameters

    • callbackfn: (value: Shard, key: string | number, map: Map<string | number, Shard>) => void
        • (value: Shard, key: string | number, map: Map<string | number, Shard>): void
        • Parameters

          • value: Shard
          • key: string | number
          • map: Map<string | number, Shard>

          Returns void

    • Optional thisArg: any

    Returns void

get

  • get(key: string | number): undefined | Shard
  • Parameters

    • key: string | number

    Returns undefined | Shard

has

  • has(key: string | number): boolean
  • Parameters

    • key: string | number

    Returns boolean

keys

  • keys(): IterableIterator<string | number>
  • Returns an iterable of keys in the map

    Returns IterableIterator<string | number>

map

  • map<R>(func: (i: Shard) => R): R[]
  • Type parameters

    • R

    Parameters

    Returns R[]

random

  • random(): undefined | Shard
  • Returns undefined | Shard

reduce

  • reduce<U>(func: (accumulator: U, val: Shard) => U, initialValue?: U): U
  • Type parameters

    • U

    Parameters

    • func: (accumulator: U, val: Shard) => U
        • (accumulator: U, val: Shard): U
        • Parameters

          • accumulator: U
          • val: Shard

          Returns U

    • Optional initialValue: U

    Returns U

remove

set

  • Parameters

    • key: string | number
    • value: Shard

    Returns ShardManager

some

  • some(func: (i: Shard) => boolean): boolean
  • Parameters

    • func: (i: Shard) => boolean
        • Parameters

          Returns boolean

    Returns boolean

spawn

  • spawn(id: number): void
  • Parameters

    • id: number

    Returns void

toJSON

  • Parameters

    • Optional props: string[]

    Returns JSONCache

toString

  • toString(): string
  • Returns string

tryConnect

  • tryConnect(): void
  • Returns void

update

  • update(obj: Shard, extra?: unknown, replace?: boolean): Shard
  • Parameters

    • obj: Shard
    • Optional extra: unknown
    • Optional replace: boolean

    Returns Shard

values

  • values(): IterableIterator<Shard>
  • Returns an iterable of values in the map

    Returns IterableIterator<Shard>

Generated using TypeDoc