@@ -4,8 +4,6 @@ use futures::future;
4
4
use futures:: FutureExt ;
5
5
use redis:: aio:: ConnectionLike ;
6
6
use redis:: aio:: ConnectionManager ;
7
- use redis:: cluster:: ClusterClient ;
8
- use redis:: cluster_async:: ClusterConnection ;
9
7
use redis:: cmd;
10
8
use redis:: AsyncCommands ;
11
9
use redis:: Client ;
@@ -22,7 +20,6 @@ use url::Url;
22
20
use crate :: error:: Result ;
23
21
24
22
pub enum ValkeyConnection {
25
- Cluster ( ClusterConnection ) ,
26
23
Tokio ( ConnectionManager ) ,
27
24
NoCache ,
28
25
}
@@ -59,7 +56,6 @@ fn no_cache_cmd_handler(cmd: &redis::Cmd) -> std::result::Result<redis::Value, R
59
56
impl ConnectionLike for ValkeyConnection {
60
57
fn req_packed_command < ' a > ( & ' a mut self , cmd : & ' a redis:: Cmd ) -> RedisFuture < ' a , redis:: Value > {
61
58
match self {
62
- ValkeyConnection :: Cluster ( connection) => connection. req_packed_command ( cmd) ,
63
59
ValkeyConnection :: Tokio ( connection) => connection. req_packed_command ( cmd) ,
64
60
ValkeyConnection :: NoCache => future:: ready ( no_cache_cmd_handler ( cmd) ) . boxed ( ) ,
65
61
}
@@ -72,9 +68,6 @@ impl ConnectionLike for ValkeyConnection {
72
68
count : usize ,
73
69
) -> RedisFuture < ' a , Vec < redis:: Value > > {
74
70
match self {
75
- ValkeyConnection :: Cluster ( connection) => {
76
- connection. req_packed_commands ( cmd, offset, count)
77
- }
78
71
ValkeyConnection :: Tokio ( connection) => {
79
72
connection. req_packed_commands ( cmd, offset, count)
80
73
}
@@ -92,7 +85,6 @@ impl ConnectionLike for ValkeyConnection {
92
85
93
86
fn get_db ( & self ) -> i64 {
94
87
match self {
95
- ValkeyConnection :: Cluster ( connection) => connection. get_db ( ) ,
96
88
ValkeyConnection :: Tokio ( connection) => connection. get_db ( ) ,
97
89
ValkeyConnection :: NoCache => 0 ,
98
90
}
@@ -267,7 +259,6 @@ impl ValkeyConnection {
267
259
268
260
#[ derive( Clone ) ]
269
261
pub enum ValkeyClient {
270
- Cluster ( ClusterClient ) ,
271
262
Tokio ( Client ) ,
272
263
/// This doesn't cache anything. It has no backend.
273
264
NoCache ,
@@ -277,7 +268,6 @@ pub enum ValkeyClient {
277
268
pub struct ValkeyConfig {
278
269
/// Disables caching. This should not be used in production.
279
270
pub no_cache : bool ,
280
- pub is_cluster_client : bool ,
281
271
pub valkey_url : Url ,
282
272
}
283
273
@@ -286,21 +276,13 @@ impl ValkeyClient {
286
276
if valkey_config. no_cache {
287
277
return Ok ( ValkeyClient :: NoCache ) ;
288
278
}
289
- if valkey_config. is_cluster_client {
290
- return Ok ( ValkeyClient :: Cluster (
291
- redis:: cluster:: ClusterClient :: new ( vec ! [ valkey_config. valkey_url] ) . unwrap ( ) ,
292
- ) ) ;
293
- }
294
279
Ok ( ValkeyClient :: Tokio (
295
280
redis:: Client :: open ( valkey_config. valkey_url ) . unwrap ( ) ,
296
281
) )
297
282
}
298
283
299
284
pub async fn get_connection ( & self ) -> RedisResult < ValkeyConnection > {
300
285
match self {
301
- ValkeyClient :: Cluster ( client) => Ok ( ValkeyConnection :: Cluster (
302
- client. get_async_connection ( ) . await ?,
303
- ) ) ,
304
286
ValkeyClient :: Tokio ( client) => Ok ( ValkeyConnection :: Tokio (
305
287
client. get_connection_manager ( ) . await ?,
306
288
) ) ,
0 commit comments