pub struct HotPathConfig {
pub enabled: bool,
pub batch_size: usize,
pub block_timeout: String,
pub adaptive_batch_size: bool,
pub min_batch_size: usize,
pub max_batch_size: usize,
pub rate_limit_enabled: bool,
pub rate_limit_per_sec: u32,
pub rate_limit_burst: u32,
}Expand description
Hot path (CDC stream tailing) configuration.
Fields§
§enabled: boolWhether hot path replication is enabled.
batch_size: usizeMaximum entries to read per XREAD call (initial batch size).
block_timeout: StringXREAD block timeout as a duration string (e.g., “5s”). Parsed to Duration internally.
adaptive_batch_size: boolEnable adaptive batch sizing (AIMD - Additive Increase, Multiplicative Decrease). When enabled, batch size adjusts based on replication lag:
- Increases when caught up (empty reads)
- Decreases when lagging (full batches)
min_batch_size: usizeMinimum batch size for adaptive sizing.
max_batch_size: usizeMaximum batch size for adaptive sizing.
rate_limit_enabled: boolEnable rate limiting for event processing. Prevents thundering herd when many peers reconnect simultaneously.
rate_limit_per_sec: u32Maximum events per second (sustained rate). Tokens refill at this rate.
rate_limit_burst: u32Maximum burst size for rate limiting. Allows short bursts above the sustained rate.
Implementations§
Source§impl HotPathConfig
impl HotPathConfig
Sourcepub fn block_timeout_duration(&self) -> Duration
pub fn block_timeout_duration(&self) -> Duration
Parse the block_timeout string to a Duration.
Sourcepub fn rate_limit_config(&self) -> Option<RateLimitConfig>
pub fn rate_limit_config(&self) -> Option<RateLimitConfig>
Create rate limit configuration from hot path settings.
Returns None if rate limiting is disabled.
Trait Implementations§
Source§impl Clone for HotPathConfig
impl Clone for HotPathConfig
Source§fn clone(&self) -> HotPathConfig
fn clone(&self) -> HotPathConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HotPathConfig
impl Debug for HotPathConfig
Source§impl Default for HotPathConfig
impl Default for HotPathConfig
Source§impl<'de> Deserialize<'de> for HotPathConfig
impl<'de> Deserialize<'de> for HotPathConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for HotPathConfig
impl RefUnwindSafe for HotPathConfig
impl Send for HotPathConfig
impl Sync for HotPathConfig
impl Unpin for HotPathConfig
impl UnwindSafe for HotPathConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more