pub struct BatchTransformer {
pub size: usize,
/* private fields */
}Expand description
Transformer that batches events by accumulation.
Accumulates stream data values until size items are collected,
then emits them as a single JSON array. This reduces overhead for
high-volume token streaming by coalescing small chunks into fewer
deliveries.
Use flush() to retrieve any remaining buffered items
before the transformer is dropped.
Fields§
§size: usizeMaximum number of items to accumulate before emitting a batch.
Implementations§
Trait Implementations§
Source§impl Clone for BatchTransformer
impl Clone for BatchTransformer
Source§impl Debug for BatchTransformer
impl Debug for BatchTransformer
Auto Trait Implementations§
impl !Freeze for BatchTransformer
impl RefUnwindSafe for BatchTransformer
impl Send for BatchTransformer
impl Sync for BatchTransformer
impl Unpin for BatchTransformer
impl UnsafeUnpin for BatchTransformer
impl UnwindSafe for BatchTransformer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more