Skip to main content

Module cluster

Module cluster 

Source
Expand description

This module provides async functionality for Valkey 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 ferriskey::cluster::ClusterClient;
use ferriskey::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(None, None, None).await.unwrap();
    let _: () = connection.cmd("SET").arg("test").arg("test_data").await.unwrap();
    let rv: String = connection.cmd("GET").arg("test").await.unwrap();
    return rv;
}

Re-exports§

pub use crate::value::InflightRequestTracker;

Modules§

compat
This module provides Valkey Cluster support.
connections
container
routing
scan
This module implements cluster-wide scanning operations for clusters.
slotmap
topology
This module provides the functionality to refresh and calculate the cluster topology for Valkey Cluster.

Structs§

ClusterConnection
This represents an async 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§

Connect
Implements the process of connecting to a Valkey server and obtaining a connection handle.