pub fn new_batcher<I, T, E>(
items: I,
stats: Arc<BatchIteratorConnectionStats>,
mode: StreamMode,
) -> FormattedStreamExpand description
Make a new FormattedContentBatcher with a chunking strategy depending on stream mode.
In snapshot mode, batched items will not be flushed to the client until the batch is complete,
the underlying stream has terminated, or SNAPSHOT_TIMEOUT has passed since the first
item was discovered (in order to prevent client starvation).
In subscribe or snapshot-then-subscribe mode, batched items will be flushed whenever the underlying stream is pending, ensuring clients always receive latest results.