pub struct ClientPool<F: ClientFacts, P: ClientTransport> { /* private fields */ }Expand description
Connection pool to the one server address (supports async and blocking context)
There’s a worker accepting task post in bounded channel.
Even when the server address is not reachable, the worker coroutine will not exit, until ClientPool is dropped.
The background coroutine will:
- monitor the address with ping task (action 0)
- cleanup the task in channel with error_handle when the address is unhealthy
If the connection is healthy and there’s incoming, the worker will spawn another coroutine for monitor purpose.
considering:
- The task incoming might never stop until faulty pool remove from pools collection
- If ping mixed with task with real business, might blocked due to throttler of in-flight message in the stream.
Implementations§
Source§impl<F: ClientFacts, P: ClientTransport> ClientPool<F, P>
impl<F: ClientFacts, P: ClientTransport> ClientPool<F, P>
Trait Implementations§
Source§impl<F: ClientFacts, P: ClientTransport> ClientCaller for ClientPool<F, P>
impl<F: ClientFacts, P: ClientTransport> ClientCaller for ClientPool<F, P>
Source§impl<F: ClientFacts, P: ClientTransport> ClientCallerBlocking for ClientPool<F, P>
impl<F: ClientFacts, P: ClientTransport> ClientCallerBlocking for ClientPool<F, P>
Source§impl<F: ClientFacts, P: ClientTransport> Clone for ClientPool<F, P>
impl<F: ClientFacts, P: ClientTransport> Clone for ClientPool<F, P>
Auto Trait Implementations§
impl<F, P> !Freeze for ClientPool<F, P>
impl<F, P> !RefUnwindSafe for ClientPool<F, P>
impl<F, P> Send for ClientPool<F, P>
impl<F, P> Sync for ClientPool<F, P>
impl<F, P> Unpin for ClientPool<F, P>
impl<F, P> !UnwindSafe for ClientPool<F, P>
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
Mutably borrows from an owned value. Read more