Preview environment

class WorkerBootstrapper

external
declare class WorkerBootstrapper

Utility class for bootstrapping a worker thread to be used for sharding

protectedreadonlyexternal
data : WorkerData

The data passed to the worker thread

protectedreadonlyexternal
shards : Collection<number, WebSocketShard>

The shards that are managed by this worker

external
bootstrap() : Promise<void>

Bootstraps the worker thread with the provided options

protectedexternal
connect(
shardId: number
) : Promise<void>

Helper method to initiate a shard's connection process

protectedexternal
destroy() : Promise<void>

Helper method to destroy a shard

protectedexternal
setupThreadEvents() : void

Helper method to attach event listeners to the parentPort