Skip to content

ClusterContext

Defined in: packages/sharding/src/context.ts:5

What a cluster worker knows about itself. ClusterManager sets it through environment variables; readClusterContext reads it back.

clusterCount: number

Defined in: packages/sharding/src/context.ts:9

How many clusters the deployment started.


clusterId: number

Defined in: packages/sharding/src/context.ts:7

This cluster’s ID.


coordinatedIdentify: boolean

Defined in: packages/sharding/src/context.ts:15

Whether the parent hands out IDENTIFY slots for this cluster.


optional readyTimeout?: number

Defined in: packages/sharding/src/context.ts:23

Sequential startup: ms a shard may take to become READY (LUNIBEE_READY_TIMEOUT, the parent’s identify.holdTimeout).


shardCount: number

Defined in: packages/sharding/src/context.ts:11

Total shards in the deployment (what Discord calls num_shards).


shardIds: number[]

Defined in: packages/sharding/src/context.ts:13

Shards this cluster owns.


optional startup?: "safe" | "sequential"

Defined in: packages/sharding/src/context.ts:21

"sequential": hold each IDENTIFY slot until the shard is READY, so the deployment starts one shard at a time. "safe" (default): release it once the IDENTIFY is sent.