Class

WorkerShardingStrategy

Runs gateway shards in worker_threads. Workers own sockets/heartbeats/JSON.parse; dispatches are posted back to the main thread. Note: the client cache still lives on the main thread — this does not solve the memory wall. Use process-level sharding (@fluxerjs/sharding) for that.

Constructor

new WorkerShardingStrategy(manager: WebSocketManager, options: WorkerShardingStrategyOptions)

Methods

.connect()

Promise<void>

await workerShardingStrategy.connect();

.destroy(options?)

options?: { code?: number; }Promise<void>

await workerShardingStrategy.destroy();

.getPing()

number

workerShardingStrategy.getPing();

.spawn(shardIds)

shardIds: number[]Promise<void>

await workerShardingStrategy.spawn(shardIds);