[][src]Trait reool::connection_factory::ConnectionFactory

pub trait ConnectionFactory {
    type Connection: Poolable;
    fn create_connection(&self) -> NewConnection<Self::Connection>;
fn connecting_to(&self) -> &str; fn ping(
        &self,
        _timeout: Instant
    ) -> Box<dyn Future<Item = Ping, Error = ()> + Send> { ... } }

A factory for connections that always creates connections to the same node.

The factory also performs pings on a node by using a fresh connection on each ping.

Associated Types

Loading content...

Required methods

fn create_connection(&self) -> NewConnection<Self::Connection>

Create a new connection

fn connecting_to(&self) -> &str

The node this factory will connect to when a new connection is requested.

Loading content...

Provided methods

fn ping(
    &self,
    _timeout: Instant
) -> Box<dyn Future<Item = Ping, Error = ()> + Send>

Ping the connection

This will create a new connection and try a ping on it.

If a factory does not support ping it will simply fail with ().

Loading content...

Implementors

Loading content...