Module singleton
Singleton pools
This ensures that only one active connection is made.
The singleton pool wraps a MakeService<T, Req> so that it only produces a
single Service<Req>. It bundles all concurrent calls to it, so that only
one connection is made. All calls to the singleton will return a clone of
the inner service once established.
This fits the HTTP/2 case well.
Example
let mut pool = new;
let svc1 = pool.call.await?;
let svc2 = pool.call.await?;
// svc1 == svc2
Structs
- Singleton A singleton pool over an inner service.