pub struct EventBusConfigBuilder { /* private fields */ }Expand description
Builder for EventBusConfig.
Implementations§
Source§impl EventBusConfigBuilder
impl EventBusConfigBuilder
Sourcepub fn num_shards(self, n: u16) -> Self
pub fn num_shards(self, n: u16) -> Self
Set the number of shards.
Sourcepub fn ring_buffer_capacity(self, cap: usize) -> Self
pub fn ring_buffer_capacity(self, cap: usize) -> Self
Set the ring buffer capacity per shard.
Sourcepub fn backpressure_mode(self, mode: BackpressureMode) -> Self
pub fn backpressure_mode(self, mode: BackpressureMode) -> Self
Set the backpressure mode.
Sourcepub fn batch(self, config: BatchConfig) -> Self
pub fn batch(self, config: BatchConfig) -> Self
Set the batch configuration.
Sourcepub fn adapter(self, config: AdapterConfig) -> Self
pub fn adapter(self, config: AdapterConfig) -> Self
Set the adapter configuration.
Sourcepub fn scaling(self, policy: ScalingPolicy) -> Self
pub fn scaling(self, policy: ScalingPolicy) -> Self
Enable dynamic scaling with the given policy.
Sourcepub fn with_dynamic_scaling(self) -> Self
pub fn with_dynamic_scaling(self) -> Self
Enable dynamic scaling with default policy. The policy’s max_shards will be based on num_shards (resolved at build time).
Sourcepub fn without_scaling(self) -> Self
pub fn without_scaling(self) -> Self
Disable dynamic scaling (use fixed shard count).
Sourcepub fn adapter_timeout(self, timeout: Duration) -> Self
pub fn adapter_timeout(self, timeout: Duration) -> Self
Set the adapter operation timeout.
Sourcepub fn adapter_batch_retries(self, retries: u32) -> Self
pub fn adapter_batch_retries(self, retries: u32) -> Self
Set the number of retries for failed on_batch calls. 0 = no retries (default). Useful for Redis/JetStream under intermittent failures.
Sourcepub fn producer_nonce_path(self, path: impl Into<PathBuf>) -> Self
pub fn producer_nonce_path(self, path: impl Into<PathBuf>) -> Self
Persist the producer nonce at path so it survives process
restart. Recommended for any deployment using
JetStream / Redis adapters where retries-after-crash should
dedup against the prior incarnation. See
EventBusConfig::producer_nonce_path for the full doc.
Sourcepub fn build(self) -> Result<EventBusConfig, ConfigError>
pub fn build(self) -> Result<EventBusConfig, ConfigError>
Build the configuration, validating all settings.