.claim(preferred?)
preferred?: number[] → Promise<ShardLease>
Claim or renew a lease for the preferred shard range.
Interface
Claims shard ranges across hosts, heartbeats leases, publishes reshard generations.
| Name | Type | Description |
|---|---|---|
| hostIdread-only | string | Unique id for this host process. |
preferred?: number[] → Promise<ShardLease>
Claim or renew a lease for the preferred shard range.
→ Promise<void>
→ Promise<ReshardPlan | null>
Observe the current global shard generation / plan.
→ Promise<ShardLease | null>
Heartbeat to keep the lease alive.
listener: (plan: ReshardPlan) => void → () => void
Subscribe to plan changes. Returns an unsubscribe function.
totalShards: number → Promise<ReshardPlan>
Publish a new shard-count generation (e.g. after 4011 / guild growth). Hosts should drain and respawn against the new plan.
→ Promise<void>
Release all shards owned by this host.