IShardingStrategy
interface IShardingStrategy
interface IShardingStrategy
Strategies responsible for spawning, initializing connections, destroying shards, and relaying events
connect()
:
Awaitable<void>
Initializes all the shards
destroy(options?)
:
Awaitable<void>
Destroys all the shards
Name | Type | Optional | Description |
---|---|---|---|
options | Omit<WebSocketShardDestroyOptions, 'recover'> | Yes | None |
send(shardId, payload)
:
Awaitable<void>
Sends a payload to a shard
Name | Type | Optional | Description |
---|---|---|---|
shardId | number | No | None |
payload | GatewaySendPayload | No | None |
spawn(shardIds)
:
Awaitable<void>
Spawns all the shards
Name | Type | Optional | Description |
---|---|---|---|
shardIds | number[] | No | None |