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: DurationHow 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: DurationHow long a seen event id is remembered for dedup purposes.
max_in_flight_per_channel: usizeMaximum 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 practice — Config::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.