WorkerShardingStrategy
export declare class WorkerShardingStrategy implements IShardingStrategy
export declare class WorkerShardingStrategy implements IShardingStrategy
Strategy used to spawn threads in worker_threads
Implements
IShardingStrategyconstructor(manager, options)
Constructs a new instance of the
WorkerShardingStrategy
className | Type | Optional | Description |
---|---|---|---|
manager | WebSocketManager | No | None |
options | WorkerShardingStrategyOptions | No | None |
connect()
:
Promise<void>
destroy(options?)
:
Promise<void>
Name | Type | Optional | Description |
---|---|---|---|
options | Omit<WebSocketShardDestroyOptions, 'recover'> | Yes | None |
send(shardId, data)
:
void
Name | Type | Optional | Description |
---|---|---|---|
shardId | number | No | None |
data | GatewaySendPayload | No | None |
spawn(shardIds)
:
Promise<void>
Name | Type | Optional | Description |
---|---|---|---|
shardIds | number[] | No | None |