pub struct BatchPolicy {
pub max_changes: usize,
pub max_delay: Duration,
}Expand description
How the worker groups changes into one sink flush.
Batching trades a little latency for far fewer round-trips: up to
max_changes changes (or whatever has arrived after max_delay, whichever
comes first) are buffered and flushed together. max_changes: 1 reproduces
the original flush-per-change behavior.
Acks respect the batch boundary — see the module docs. The source ack for a change is confirmed only after the flush that made its documents durable, so at-least-once delivery holds regardless of batch size.
Fields§
§max_changes: usizeFlush once this many changes have accumulated. Clamped to at least 1.
max_delay: DurationFlush a partial batch this long after its first change, so a trickle of changes still lands promptly instead of waiting for a full batch.
Trait Implementations§
Source§impl Clone for BatchPolicy
impl Clone for BatchPolicy
Source§fn clone(&self) -> BatchPolicy
fn clone(&self) -> BatchPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BatchPolicy
Source§impl Debug for BatchPolicy
impl Debug for BatchPolicy
Auto Trait Implementations§
impl Freeze for BatchPolicy
impl RefUnwindSafe for BatchPolicy
impl Send for BatchPolicy
impl Sync for BatchPolicy
impl Unpin for BatchPolicy
impl UnsafeUnpin for BatchPolicy
impl UnwindSafe for BatchPolicy
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