The Kinetex client to send requests through.
Batch configuration options.
OptionalmaxBatch?: numberMaximum number of requests to flush at once. When this many requests are queued, flush immediately. Default: 100
OptionalflushMs?: numberMilliseconds to wait before flushing an incomplete batch. Allows requests fired in the same event-loop tick to coalesce. Default: 0 (flush on next microtask)
How many requests are currently queued (not yet sent).
Enqueue a request. Returns a promise that resolves when the batch containing this request has been sent and the response is ready.
Request URL.
HTTP method (default GET).
Per-request options.
A promise resolving with the response.
Flush any pending requests immediately without waiting for the timer. Loops until the queue is empty so items beyond maxBatch are not orphaned.
Batch request queue — coalesces individual requests fired within the same micro-task tick (or within
flushMs) into a concurrentPromise.allburst, sharing a single connection pool flush.This is a high-throughput helper for write-heavy scenarios (e.g. event ingestion, metric flushing) where you want to fire many requests quickly without overloading the event loop one-by-one.
Example
See
Enterprise Hardening #4 — Request batching for high-throughput scenarios