pub struct RouterLoopConfig {
pub source: RouterSource,
pub mode: RouterMode,
pub policy: BackpressurePolicy,
pub credit: Option<CreditConfig>,
pub batch_max: u32,
pub batch_time_us: Option<u32>,
pub yield_every: u32,
pub idle_spin_limit: u32,
}Expand description
Configuration for a routing loop.
§Batching
The loop routes messages sequentially. Batching repeats single-message routing up to
batch_max times per iteration; it does not reorder messages.
§Feature notes
batch_time_usandyield_everyare only effective with thestdfeature.
Fields§
§source: RouterSourceProducer queue to drain from (Spsc or Mpsc).
mode: RouterModeRouting mode (Broadcast or WorkQueue).
policy: BackpressurePolicyBackpressure behavior when routing cannot make progress.
credit: Option<CreditConfig>Optional router-enforced credit enforcement.
batch_max: u32Maximum number of messages to route per loop iteration.
Notes:
0is treated as1.- Batching never reorders messages; it just repeats
route_once_with_stats.
batch_time_us: Option<u32>Optional time cap for a single batch.
This is best-effort and only enforced when the std feature is enabled.
yield_every: u32Fairness knob: yield the current thread every N loop iterations.
Only effective with the std feature; otherwise ignored.
idle_spin_limit: u32When idle, spin up to this many times before invoking the wait strategy.
This provides a bounded low-latency polling window without requiring a custom
WaitStrategy implementation.
Trait Implementations§
Source§impl Clone for RouterLoopConfig
impl Clone for RouterLoopConfig
Source§fn clone(&self) -> RouterLoopConfig
fn clone(&self) -> RouterLoopConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more