Struct redis::aio::MultiplexedConnection
source · pub struct MultiplexedConnection { /* private fields */ }
Available on crate feature
aio
only.Expand description
A connection object which can be cloned, allowing requests to be be sent concurrently on the same underlying connection (tcp/unix socket).
Implementations§
source§impl MultiplexedConnection
impl MultiplexedConnection
sourcepub async fn new<C>(
connection_info: &RedisConnectionInfo,
stream: C
) -> RedisResult<(Self, impl Future<Output = ()>)>where
C: Unpin + AsyncRead + AsyncWrite + Send + 'static,
pub async fn new<C>( connection_info: &RedisConnectionInfo, stream: C ) -> RedisResult<(Self, impl Future<Output = ()>)>where C: Unpin + AsyncRead + AsyncWrite + Send + 'static,
Constructs a new MultiplexedConnection
out of a AsyncRead + AsyncWrite
object
and a ConnectionInfo
sourcepub async fn send_packed_command(&mut self, cmd: &Cmd) -> RedisResult<Value>
pub async fn send_packed_command(&mut self, cmd: &Cmd) -> RedisResult<Value>
Sends an already encoded (packed) command into the TCP socket and reads the single response from it.
sourcepub async fn send_packed_commands(
&mut self,
cmd: &Pipeline,
offset: usize,
count: usize
) -> RedisResult<Vec<Value>>
pub async fn send_packed_commands( &mut self, cmd: &Pipeline, offset: usize, count: usize ) -> RedisResult<Vec<Value>>
Sends multiple already encoded (packed) command into the TCP socket
and reads count
responses from it. This is used to implement
pipelining.
Trait Implementations§
source§impl Clone for MultiplexedConnection
impl Clone for MultiplexedConnection
source§fn clone(&self) -> MultiplexedConnection
fn clone(&self) -> MultiplexedConnection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Connect for MultiplexedConnection
impl Connect for MultiplexedConnection
source§fn connect<'a, T>(info: T) -> RedisFuture<'a, MultiplexedConnection>where
T: IntoConnectionInfo + Send + 'a,
fn connect<'a, T>(info: T) -> RedisFuture<'a, MultiplexedConnection>where T: IntoConnectionInfo + Send + 'a,
Connect to a node, returning handle for command execution.
source§impl ConnectionLike for MultiplexedConnection
impl ConnectionLike for MultiplexedConnection
source§fn req_packed_command<'a>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, Value>
fn req_packed_command<'a>(&'a mut self, cmd: &'a Cmd) -> RedisFuture<'a, Value>
Sends an already encoded (packed) command into the TCP socket and
reads the single response from it.
source§fn req_packed_commands<'a>(
&'a mut self,
cmd: &'a Pipeline,
offset: usize,
count: usize
) -> RedisFuture<'a, Vec<Value>>
fn req_packed_commands<'a>( &'a mut self, cmd: &'a Pipeline, offset: usize, count: usize ) -> RedisFuture<'a, Vec<Value>>
Sends multiple already encoded (packed) command into the TCP socket
and reads
count
responses from it. This is used to implement
pipelining.