pub struct AgentPoolConfig {Show 13 fields
pub connections_per_agent: usize,
pub load_balance_strategy: LoadBalanceStrategy,
pub connect_timeout: Duration,
pub request_timeout: Duration,
pub reconnect_interval: Duration,
pub max_reconnect_attempts: usize,
pub drain_timeout: Duration,
pub max_concurrent_per_connection: usize,
pub health_check_interval: Duration,
pub channel_buffer_size: usize,
pub flow_control_mode: FlowControlMode,
pub flow_control_wait_timeout: Duration,
pub sticky_session_timeout: Option<Duration>,
}Expand description
Configuration for the agent connection pool.
Fields§
§connections_per_agent: usizeNumber of connections to maintain per agent
load_balance_strategy: LoadBalanceStrategyLoad balancing strategy
connect_timeout: DurationConnection timeout
request_timeout: DurationRequest timeout
reconnect_interval: DurationTime between reconnection attempts
max_reconnect_attempts: usizeMaximum reconnection attempts before marking agent unhealthy
drain_timeout: DurationTime to wait for in-flight requests during shutdown
max_concurrent_per_connection: usizeMaximum concurrent requests per connection
health_check_interval: DurationHealth check interval
channel_buffer_size: usizeChannel buffer size for all transports.
Controls backpressure behavior. Smaller values (16-64) apply backpressure earlier, preventing memory buildup. Larger values (128-256) handle burst traffic better but use more memory.
Default: 64
flow_control_mode: FlowControlModeFlow control behavior when an agent signals it cannot accept requests.
Default: FlowControlMode::FailClosed
flow_control_wait_timeout: DurationTimeout for FlowControlMode::WaitAndRetry before failing.
Only used when flow_control_mode is WaitAndRetry.
Default: 100ms
sticky_session_timeout: Option<Duration>Timeout for sticky sessions before they expire.
Sticky sessions are used for long-lived streaming connections (WebSocket, SSE, long-polling) to ensure the same agent connection is used for the entire stream lifetime.
Set to None to disable automatic expiry (sessions only cleared explicitly).
Default: 5 minutes
Trait Implementations§
Source§impl Clone for AgentPoolConfig
impl Clone for AgentPoolConfig
Source§fn clone(&self) -> AgentPoolConfig
fn clone(&self) -> AgentPoolConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentPoolConfig
impl Debug for AgentPoolConfig
Auto Trait Implementations§
impl Freeze for AgentPoolConfig
impl RefUnwindSafe for AgentPoolConfig
impl Send for AgentPoolConfig
impl Sync for AgentPoolConfig
impl Unpin for AgentPoolConfig
impl UnwindSafe for AgentPoolConfig
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request