pub struct HttpPooledConnectorConfig {
pub max_total: usize,
pub max_concurrent_streams: usize,
pub selection: MuxSelection,
pub idle_timeout: Option<Duration>,
pub wait_for_pool_timeout: Option<Duration>,
}Expand description
Config used to create a multiplexing http connection pool (MultiplexPool).
The per-connection concurrency comes from the connection’s
MaxConcurrency extension (set by the http
connectors: 1 for http/1, the stream capacity for http/2), clamped to
max_concurrent_streams as an upper bound.
Fields§
§max_total: usizeSet the max amount of connections that this connection pool will contain
This is the sum of active connections and idle connections. When this limit is hit idle connections will be replaced with new ones.
max_concurrent_streams: usizeUpper bound on the concurrent requests a single connection may serve.
Acts as a ceiling for each connection, each connection also figures it’s own max concurrency out by itself
selection: MuxSelectionHow a connection is chosen among several that can serve a request.
idle_timeout: Option<Duration>If connections have been idle (no active streams) for longer than this timeout they are dropped. Only checked when a connection is requested.
wait_for_pool_timeout: Option<Duration>How long to wait for the pool to hand out a connection before timing out.
Implementations§
Source§impl HttpPooledConnectorConfig
impl HttpPooledConnectorConfig
Sourcepub fn build_default_connector<S>(inner: S) -> HttpPooledConnector<S>where
S: ConnectorService<ConnectRequest>,
pub fn build_default_connector<S>(inner: S) -> HttpPooledConnector<S>where
S: ConnectorService<ConnectRequest>,
Build a pooled HTTP connector using Rama’s known-valid default limits.
Unlike Self::try_build_connector, this constructor is infallible because
its connection and concurrency limits are non-zero constants owned by
Rama.
Sourcepub fn try_build_connector<S>(
self,
inner: S,
) -> Result<HttpPooledConnector<S>, BoxError>where
S: ConnectorService<ConnectRequest>,
pub fn try_build_connector<S>(
self,
inner: S,
) -> Result<HttpPooledConnector<S>, BoxError>where
S: ConnectorService<ConnectRequest>,
Build a pooled HTTP connector around inner.
The connector only adds body binding and pool lookup. HTTP request adaptation and proxy-route selection remain independently composable services and can be layered around the returned connector when needed.
The returned connector wraps each pooled connection in
BindBodyToConn, so the pool only frees/reuses a
connection once its response body has been consumed, not at response
headers.
Warning: the connection returned by this pool should only be used for a single request. Every request should go through the connector stack again, and will receive a new or reused connection (maybe multiplexed) of its own.
Trait Implementations§
Source§impl Clone for HttpPooledConnectorConfig
impl Clone for HttpPooledConnectorConfig
Source§impl Debug for HttpPooledConnectorConfig
impl Debug for HttpPooledConnectorConfig
Auto Trait Implementations§
impl Freeze for HttpPooledConnectorConfig
impl RefUnwindSafe for HttpPooledConnectorConfig
impl Send for HttpPooledConnectorConfig
impl Sync for HttpPooledConnectorConfig
impl Unpin for HttpPooledConnectorConfig
impl UnsafeUnpin for HttpPooledConnectorConfig
impl UnwindSafe for HttpPooledConnectorConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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