You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

WorkerBootstrapper

export declare class WorkerBootstrapper
export declare class WorkerBootstrapper
Utility class for bootstrapping a worker thread to be used for sharding
constructor()
Constructs a new instance of the WorkerBootstrapper class
NameTypeOptionalDescription
ProtectedReadonly
The data passed to the worker thread
ProtectedReadonly
shards:Collection<number, WebSocketShard>
The shards that are managed by this worker
bootstrap(options?):Promise<void>
Bootstraps the worker thread with the provided options
NameTypeOptionalDescription
optionsReadonly<BootstrapOptions>YesNone
Protected
connect(shardId):Promise<void>
Helper method to initiate a shard's connection process
NameTypeOptionalDescription
shardIdnumberNoNone
Protected
destroy(shardId, options?):Promise<void>
Helper method to destroy a shard
NameTypeOptionalDescription
shardIdnumberNoNone
optionsWebSocketShardDestroyOptionsYesNone
Protected
setupThreadEvents():void
Helper method to attach event listeners to the parentPort