pub struct BatchConfig {
pub max_items: usize,
pub max_delay: Duration,
}Expand description
Controls automatic batching for stream and feed channels. Items are accumulated and flushed as a batch when either condition is met (whichever comes first):
max_itemsitems have accumulatedmax_delayhas elapsed since the first item in the current batch
A batched list of items will be wrapped into a single WireEnvelope at the transport layer, sharing the same MessageId and headers. Byte-level concerns (frame size limits, throttling) are handled by the transport layer, not the batch writer.
Fields§
§max_items: usizeMaximum items per batch. When this many items accumulate, the batch is flushed immediately.
max_delay: DurationMaximum time to wait for more items before flushing.
If fewer than max_items are buffered but this duration
elapses since the first item, the batch is flushed.
Implementations§
Trait Implementations§
Source§impl Clone for BatchConfig
impl Clone for BatchConfig
Source§fn clone(&self) -> BatchConfig
fn clone(&self) -> BatchConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatchConfig
impl Debug for BatchConfig
Auto Trait Implementations§
impl Freeze for BatchConfig
impl RefUnwindSafe for BatchConfig
impl Send for BatchConfig
impl Sync for BatchConfig
impl Unpin for BatchConfig
impl UnsafeUnpin for BatchConfig
impl UnwindSafe for BatchConfig
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