diff --git a/glide-core/redis-rs/redis/src/cluster_async/mod.rs b/glide-core/redis-rs/redis/src/cluster_async/mod.rs index e008aad4a1..cb408d13f5 100644 --- a/glide-core/redis-rs/redis/src/cluster_async/mod.rs +++ b/glide-core/redis-rs/redis/src/cluster_async/mod.rs @@ -2248,16 +2248,17 @@ where /// Suppose we have a pipeline with multiple commands that were split and executed on different nodes. /// This function will aggregate the responses for commands that were split across multiple nodes. /// - /// ```rust,no_run + /// ```rust,compile_fail /// // Example pipeline with commands that might be split across nodes + /// /// let mut pipeline_responses = vec![ - /// vec![(Value::Int(1), "node1".to_string()), (Value::Int(2), "node2".to_string())], (Value::Int(3), "node3".to_string())] // represents `DBSIZE`` + /// vec![(Value::Int(1), "node1".to_string()), (Value::Int(2), "node2".to_string()), (Value::Int(3), "node3".to_string())], // represents `DBSIZE` /// vec![(Value::Int(3), "node3".to_string())], - /// vec![(Value::SimpleString("PONG"), "node1".to_string()), (Value::SimpleString("PONG"), "node2".to_string()), (Value::SimpleString("PONG"), "node3".to_string())], // represents `PING` + /// vec![(Value::SimpleString("PONG".to_string()), "node1".to_string()), (Value::SimpleString("PONG".to_string()), "node2".to_string()), (Value::SimpleString("PONG".to_string()), "node3".to_string())], // represents `PING` /// ]; /// let response_policies = vec![ /// (0, MultipleNodeRoutingInfo::AllNodes, Some(ResponsePolicy::Aggregate(AggregateOp::Sum))), - /// (2, MultipleNodeRoutingInfo::AllNodes, Some(ResponsePolicy::AllSuceeded), + /// (2, MultipleNodeRoutingInfo::AllNodes, Some(ResponsePolicy::AllSucceeded)), /// ]; /// /// // Aggregating the responses @@ -2266,7 +2267,7 @@ where /// // After aggregation, pipeline_responses will be updated with aggregated results /// assert_eq!(pipeline_responses[0], vec![(Value::Int(6), "".to_string())]); /// assert_eq!(pipeline_responses[1], vec![(Value::Int(3), "node3".to_string())]); - /// assert_eq!(pipeline_responses[2], vec![(Value::SimpleString("PONG"), "".to_string())]); + /// assert_eq!(pipeline_responses[2], vec![(Value::SimpleString("PONG".to_string()), "".to_string())]); /// ``` /// /// This function is essential for handling multi-node commands in a Redis cluster, ensuring that responses from different nodes are correctly aggregated and processed. diff --git a/glide-core/redis-rs/redis/src/pipeline.rs b/glide-core/redis-rs/redis/src/pipeline.rs index fea54ee7ff..c0dc068ead 100644 --- a/glide-core/redis-rs/redis/src/pipeline.rs +++ b/glide-core/redis-rs/redis/src/pipeline.rs @@ -72,18 +72,8 @@ impl Pipeline { self } - /// This enables sub-pipeline mode. In sub-pipeline mode, the whole pipeline is enclosed in - /// `MULTI`/`EXEC` and the return value is a nested array of results. This is useful when - /// you want to execute a pipeline inside another pipeline. - /// ```rust,no_run - /// # let client = redis::Client::open("redis:// - /// 127.0.0.1/").unwrap(); - /// # let mut con = client.get_connection(None).unwrap(); - /// let (k1, k2) : (i32, i32) = redis::pipe() - /// .atomic() - /// .cmd("SET").arg("key_1").arg(42).ignore() - /// - /// + /// Enables sub-pipeline mode, indicating that this pipeline is part of a larger pipeline + /// split across multiple nodes. pub fn sub_pipeline(&mut self) -> &mut Pipeline { self.is_sub_pipeline = true; self