Buffers events and triggers a background flush when the batch size threshold is reached. Returns immediately — callers are never blocked by network I/O.
Flushes buffered events to the underlying sink.
If a flush is already in progress, returns that same promise so that multiple concurrent callers share a single write rather than spawning concurrent network requests.
Production-grade batching wrapper for log sinks.
Provides buffering, retry with exponential backoff, and circuit breaking. All network/file sinks use this internally.
Example