IdentifyCoordinatorOptions
Defined in: packages/sharding/src/identify.ts:15
Options for an IdentifyCoordinator.
Properties
Section titled “Properties”budget?
Section titled “budget?”
optionalbudget?:IdentifyBudget
Defined in: packages/sharding/src/identify.ts:21
The session-start budget, when known. Without it the coordinator paces but never blocks.
cancel?
Section titled “cancel?”
optionalcancel?: (handle) =>void
Defined in: packages/sharding/src/identify.ts:28
Parameters
Section titled “Parameters”handle
Section titled “handle”unknown
Returns
Section titled “Returns”void
holdTimeout?
Section titled “holdTimeout?”
optionalholdTimeout?:number
Defined in: packages/sharding/src/identify.ts:23
A granted slot that is not released within this many ms is released for the holder. Default 60,000.
interval?
Section titled “interval?”
optionalinterval?:number
Defined in: packages/sharding/src/identify.ts:19
Milliseconds between two IDENTIFYs on one key. Default 5000.
maxConcurrency?
Section titled “maxConcurrency?”
optionalmaxConcurrency?:number
Defined in: packages/sharding/src/identify.ts:17
Discord’s max_concurrency: shards with the same id % maxConcurrency share a key. Default 1.
optionalnow?: () =>number
Defined in: packages/sharding/src/identify.ts:25
Clock, injectable for tests.
Returns
Section titled “Returns”number
onBudgetWait?
Section titled “onBudgetWait?”
optionalonBudgetWait?: (info) =>void
Defined in: packages/sharding/src/identify.ts:30
Called when a request has to wait for the budget to reset.
Parameters
Section titled “Parameters”shardId
Section titled “shardId”number
waitMs
Section titled “waitMs”number
Returns
Section titled “Returns”void
onEvent?
Section titled “onEvent?”
optionalonEvent?: (event) =>void
Defined in: packages/sharding/src/identify.ts:32
Called for every queue change, for logs and metrics.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
schedule?
Section titled “schedule?”
optionalschedule?: (callback,ms) =>unknown
Defined in: packages/sharding/src/identify.ts:27
Timer, injectable for tests. Must return a handle cancel understands.
Parameters
Section titled “Parameters”callback
Section titled “callback”() => void
number
Returns
Section titled “Returns”unknown