Struct HttpPooledConnectorConfig
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>,
}http-full and http and std only.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§
§impl HttpPooledConnectorConfig
impl HttpPooledConnectorConfig
pub fn build_connector<S>(
self,
inner: S,
) -> Result<BindBodyToConnector<PooledConnector<S, MultiplexPool<<S as ConnectorService<Request>>::Connection, BasicHttpConId>, BasicHttpConnIdentifier>>, Box<dyn Error + Send + Sync>>where
S: ConnectorService<Request>,
pub fn build_connector<S>(
self,
inner: S,
) -> Result<BindBodyToConnector<PooledConnector<S, MultiplexPool<<S as ConnectorService<Request>>::Connection, BasicHttpConId>, BasicHttpConnIdentifier>>, Box<dyn Error + Send + Sync>>where
S: ConnectorService<Request>,
Build a pooled http connector around inner.
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 resused connection (maybe multiplexed) of its own from.
Trait Implementations§
§impl Clone for HttpPooledConnectorConfig
impl Clone for HttpPooledConnectorConfig
§fn clone(&self) -> HttpPooledConnectorConfig
fn clone(&self) -> HttpPooledConnectorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HttpPooledConnectorConfig
impl Debug for HttpPooledConnectorConfig
§impl Default for HttpPooledConnectorConfig
impl Default for HttpPooledConnectorConfig
§fn default() -> HttpPooledConnectorConfig
fn default() -> 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer