Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub id: Option<String>,
    pub router_channel: Option<String>,
    pub request_ttl: Duration,
    pub event_ttl: Duration,
    pub max_in_flight_per_channel: usize,
}
Expand description

Configuration for a CommandRegistry.

Fields§

§id: Option<String>

Registry identifier used in log messages. Defaults to a random UUID.

§router_channel: Option<String>

Channel id to escalate unknown commands and new registrations to. Leave None for a root registry.

§request_ttl: Duration

How long a pending execute / register reply can wait before being rejected with CommandError::Timeout. Zero disables the TTL check (request hangs until the channel closes).

§event_ttl: Duration

How long a seen event id is remembered for dedup purposes.

§max_in_flight_per_channel: usize

Maximum number of handler futures that may be in flight concurrently on a single channel’s pump. Once this cap is reached, the pump stops pulling new messages off the channel (applying upstream backpressure) until an in-flight handler finishes. 0 disables the cap.

Optional in practiceConfig::default() sets this to 256, so callers using ..Default::default() never need to supply it. It is only syntactically required when you build Config { … } field-by-field (Rust struct literals must list every field). The cap exists so a misbehaving peer can’t cause unbounded handler-future buildup; the default is fine for almost every workload.

Trait Implementations§

Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.