[−][src]Struct redis::aio::ConnectionManager
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
MultiplexedConnectionor to aRedisError - 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]
fn clone(&self) -> ConnectionManager[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl ConnectionLike for ConnectionManager[src]
fn req_packed_command<'a>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, Value>[src]
fn req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize
) -> RedisFuture<'a, Vec<Value>>[src]
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize
) -> RedisFuture<'a, Vec<Value>>
fn get_db(&self) -> i64[src]
Auto Trait Implementations
impl !RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl !UnwindSafe for ConnectionManager
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,