Search...

SimpleShardingStrategy

declare class SimpleShardingStrategy implements IShardingStrategy
declare class SimpleShardingStrategy implements IShardingStrategy
Simple strategy that just spawns shards in the current process

constructor(manager)

Constructs a new instance of the SimpleShardingStrategy class
NameTypeOptionalDescription
managerWebSocketManagerNoNone

connect()

:

Promise<void>

Initializes all the shards

destroy(options?)

:

Promise<void>

Destroys all the shards
NameTypeOptionalDescription
optionsOmit<WebSocketShardDestroyOptions, 'recover'>YesNone

send(shardId, payload)

:

Promise<void>

Sends a payload to a shard
NameTypeOptionalDescription
shardIdnumberNoNone
payloadGatewaySendPayloadNoNone

spawn(shardIds)

:

Promise<void>

Spawns all the shards
NameTypeOptionalDescription
shardIdsnumber[]NoNone