BatchScheduler
Defined in: batch-scheduler.ts:25
Coalesces service calls made within the same window (default: same microtask
tick) into a single POST /batch request. Each caller’s promise settles
independently from its own BatchResult entry. Queues longer than maxSize
split into multiple requests instead of erroring client-side.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new BatchScheduler(
rest,options?,refresh?):BatchScheduler
Defined in: batch-scheduler.ts:31
Parameters
Section titled “Parameters”options?
Section titled “options?”maxSize?
Section titled “maxSize?”number
windowMs?
Section titled “windowMs?”number
refresh?
Section titled “refresh?”() => Promise<boolean>
Token refresh — entries failing with a per-entry 401 are retried once after a successful refresh.
Returns
Section titled “Returns”BatchScheduler
Methods
Section titled “Methods”enqueue()
Section titled “enqueue()”enqueue(
call):Promise<unknown>
Defined in: batch-scheduler.ts:41
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<unknown>