Skip to main content

Module multiplex

Module multiplex 

Available on crate feature net only.
Expand description

Multiplexing connection pool.

MultiplexPool keeps every connection in storage and hands out a cheap MultiplexedConnection that shares a connection connection through &self. A single connection serves up to min(max_concurrent_streams, MaxConcurrency) concurrent users (where MaxConcurrency is the connection’s advertised capacity, defaulting to usize::MAX when unset), the exclusive super::LruDropPool is the special case of capacity = 1 for owned connections. If the connection pool is at max capacity the pool will wait until a connection with a matching ID has capacity again or it will evict an idle connection with a LRU policy.

Because the connector stack runs for every request, a MultiplexedConnection is established, serves its single request, and is dropped, so a MultiplexedConnection is bound to exactly one connection (its super::ExtensionsRef forwards to that connection, which is required for extension propagation such as the negotiated http version) and concurrency is metered by counting live handouts. A MultiplexedConnection is not meant to outlive a single logical request and when it does it should only be used for one input/request at a time.

Structs§

MultiplexPool
Connection pool that multiplexes concurrent users over shared connections.
MultiplexedConnection
A cheap handle to a shared connection in a MultiplexPool.

Enums§

MuxSelection
Strategy used to pick a connection among several that share the same ConnID and still have stream capacity.