[][src]Struct redis::aio::ConnectionManager

pub struct ConnectionManager { /* fields omitted */ }

A ConnectionManager is a proxy that wraps a multiplexed connection and automatically reconnects to the server when necessary.

Like the MultiplexedConnection, this manager can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).

Behavior

  • When creating an instance of the ConnectionManager, an initial connection will be established and awaited. Connection errors will be returned directly.
  • When a command sent to the server fails with an error that represents a "connection dropped" condition, that error will be passed on to the user, but it will trigger a reconnection in the background.
  • The reconnect code will atomically swap the current (dead) connection with a future that will eventually resolve to a MultiplexedConnection or to a RedisError
  • All commands that are issued after the reconnect process has been initiated, will have to await the connection future.
  • If reconnecting fails, all pending commands will be failed as well. A new reconnection attempt will be triggered if the error is an I/O error.

Implementations

impl ConnectionManager[src]

pub async fn new(connection_info: ConnectionInfo) -> RedisResult<Self>[src]

Connect to the server and store the connection inside the returned ConnectionManager.

This requires the connection-manager feature, which will also pull in the Tokio executor.

Trait Implementations

impl Clone for ConnectionManager[src]

impl ConnectionLike for ConnectionManager[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,