Module redis::cluster_async
source · Expand description
This module provides async functionality for Redis Cluster.
By default, ClusterConnection
makes use of MultiplexedConnection
and maintains a pool
of connections to each node in the cluster. While it generally behaves similarly to
the sync cluster module, certain commands do not route identically, due most notably to
a current lack of support for routing commands to multiple nodes.
Also note that pubsub functionality is not currently provided by this module.
§Example
use redis::cluster::ClusterClient;
use redis::AsyncCommands;
async fn fetch_an_integer() -> String {
let nodes = vec!["redis://127.0.0.1/"];
let client = ClusterClient::new(nodes).unwrap();
let mut connection = client.get_async_connection().await.unwrap();
let _: () = connection.set("test", "test_data").await.unwrap();
let rv: String = connection.get("test").await.unwrap();
return rv;
}
Structs§
- This represents an async Redis Cluster connection. It stores the underlying connections maintained for each node in the cluster, as well as common parameters for connecting to nodes and executing commands.
Traits§
- Implements the process of connecting to a Redis server and obtaining a connection handle.