pub struct BatchConfig {
pub window: Duration,
pub max: usize,
pub channel_capacity: usize,
}Expand description
Batching policy for watch_applied.
A flush fires when either bound is hit, whichever comes first: window
time has elapsed since the batch opened, or max updates have accumulated.
The window amortizes the cost of apply (e.g. one route-table clone per
flush instead of one per update); max caps memory and latency when updates
arrive faster than the window.
Fields§
§window: DurationMaximum time a batch stays open before being flushed.
max: usizeMaximum number of parsed updates in a batch before forcing a flush.
channel_capacity: usizeCapacity of the internal watch-task → main-loop channel. When the main
loop falls behind (slow apply, blocking store flush), a full channel
backpressures the watch task — that is the design — but during initial
state-sync hydration of a large bucket the channel can fill faster than
the window flushes, making this the effective batch boundary rather
than max. Tune it together with max for high-fanout
hydration; clamped to a minimum of 1.
Trait Implementations§
Source§impl Clone for BatchConfig
impl Clone for BatchConfig
Source§fn clone(&self) -> BatchConfig
fn clone(&self) -> BatchConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more