class WorkerShardingStrategy
implements
IShardingStrategyexport declare class WorkerShardingStrategy implements IShardingStrategy
Strategy used to spawn threads in worker_threads
Constructors
manager: WebSocketManageroptions: WorkerShardingStrategyOptions)
constructor(manager: WebSocketManager
options: WorkerShardingStrategyOptions
Constructs a new instance of the WorkerShardingStrategy
class
connectPromise<void> () :
Initializes all the shards
destroyoptions?: Omit<WebSocketShardDestroyOptions, 'recover'>) : Promise<void> (
options?: Omit<WebSocketShardDestroyOptions, 'recover'>
Destroys all the shards
sendshardId: numberdata: GatewaySendPayload) : void (
shardId: number
data: GatewaySendPayload
Sends a payload to a shard
spawnshardIds: number[]) : Promise<void> (
shardIds: number[]
Spawns all the shards