-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get nodes from cluster client #991
Comments
Routing will be exposed in the async cluster in the next release ( redis-rs/redis/src/cluster_async/mod.rs Line 103 in a6df6e2
As for being able to iterate over the connections of each node - I believe that will be simple in the sync cluster connection, but not so simple in the async one, due to its disjoint structure. Again, contributions will be very much appreciated. |
@danprueitt has this issue been fully or partially mitigated in 0.25.0? |
Not exactly a solution to this, but anyway, for reference, I was able to make something work by hashtagging my keys and obtaining a let routing_info = RoutingInfo::SingleNode(SpecificNode(Route::new(
get_slot("{my_pattern}".as_bytes()),
ReplicaOptional,
))); (Imports are from the And then using that with the newly exposed let foo_cmd = redis::cmd("SCAN")
.cursor_arg(0)
.arg("MATCH")
.arg("{my_pattern}:*")
.arg("COUNT")
.arg(1000)
.to_owned();
let my_res = my_conn.route_command(&foo_cmd, routing_info).await?; |
I want to scan match each node in my redis cluster. As far as i can see, the routing for scan is random and there are no exposed functions I'm aware of that give the ability to change the routing to all read replicas or all masters exposed to the user.
My next thought was to iterate over the connections in my cluster and perform the operation on each node, but I can't see a get_connections or similar command to iterate over.
I do have the initial connection strings that i could use to open a new connection to each node manually but I want to check I'm not missing anything. If I'm not, would it make sense to expose routing or be able to iterate over the connections to each node?
The text was updated successfully, but these errors were encountered: