BatcherOptions
Defined in: src/batcher.ts:4
Type Parameters
Section titled “Type Parameters”I
R
Properties
Section titled “Properties”
optionalkey?: (item) =>string
Defined in: src/batcher.ts:15
Items with the same key share one slot in a batch (and one result). Required when run returns a Map.
Parameters
Section titled “Parameters”I
Returns
Section titled “Returns”string
maxSize
Section titled “maxSize”maxSize:
number
Defined in: src/batcher.ts:6
Flush as soon as the batch holds this many (distinct) items.
maxWait
Section titled “maxWait”maxWait:
Duration
Defined in: src/batcher.ts:8
Flush this long after the first item of a batch arrived.
pipeline?
Section titled “pipeline?”
optionalpipeline?:ResiliencePipeline<any,any>
Defined in: src/batcher.ts:17
Each batch runs through it as a unit (retried, timed out, rate limited together).
run: (
items,context) =>Promise<readonly (Error|R)[] |ReadonlyMap<string,Error|R>>
Defined in: src/batcher.ts:13
Loads a batch. Return one result per item, in order, or a Map by key. A result that is an Error rejects only that item.
Gets the pipeline’s context: pass context.signal on to your I/O.
Parameters
Section titled “Parameters”I[]
context
Section titled “context”Returns
Section titled “Returns”Promise<readonly (Error | R)[] | ReadonlyMap<string, Error | R>>
timeProvider?
Section titled “timeProvider?”
optionaltimeProvider?:TimeProvider
Defined in: src/batcher.ts:18