Description
Many connection management and server management commands are declared abstract on BaseClient and then implemented identically (or near-identically) in both GlideClient and GlideClusterClient. The cluster client explicitly passes a route (e.g., Route.Random, AllPrimaries), but in most cases this matches the redis-rs default routing that glide-core applies when no route is provided.
This means the no-route overloads could be consolidated into a single concrete implementation on BaseClient, eliminating duplication.
Commands where glide-core default routing matches GlideClusterClient's explicit route:
| Command |
Default Route |
CLIENT GETNAME |
Random |
CLIENT ID |
Random |
CLIENT PAUSE |
AllPrimaries |
CLIENT PAUSE (write) |
AllPrimaries |
CLIENT UNPAUSE |
AllPrimaries |
CLIENT TRACKINGINFO |
Random |
ECHO |
Random |
PING |
AllPrimaries |
Commands where glide-core default does NOT match (requires investigation):
| Command |
Default Route |
Cluster Client Uses |
SELECT |
AllNodes |
Random |
RESET |
AllNodes |
(no cluster override) |
The scope includes connection management commands initially, but the same pattern likely applies to server management commands as well.
Checklist
Related
Additional Information
- The route-specific overloads (e.g.,
ClientGetNameAsync(Route route)) on GlideClusterClient are unaffected — those stay as cluster-only methods.
- This refactor reduces code duplication and ensures routing is consistently sourced from glide-core rather than being manually specified in C#.
Description
Many connection management and server management commands are declared
abstractonBaseClientand then implemented identically (or near-identically) in bothGlideClientandGlideClusterClient. The cluster client explicitly passes a route (e.g.,Route.Random,AllPrimaries), but in most cases this matches the redis-rs default routing that glide-core applies when no route is provided.This means the no-route overloads could be consolidated into a single concrete implementation on
BaseClient, eliminating duplication.Commands where glide-core default routing matches
GlideClusterClient's explicit route:CLIENT GETNAMECLIENT IDCLIENT PAUSECLIENT PAUSE(write)CLIENT UNPAUSECLIENT TRACKINGINFOECHOPINGCommands where glide-core default does NOT match (requires investigation):
SELECTRESETThe scope includes connection management commands initially, but the same pattern likely applies to server management commands as well.
Checklist
BaseClientabstract methods where bothGlideClientandGlideClusterClientoverride with the sameRequest.X()call (differing only by route).GlideClusterClient.BaseClientas concrete methods.SELECTrouted as Random vs AllNodes default;RESEThas no cluster override).Related
valkey-glide/glide-core/redis-rs/redis/src/cluster_routing.rs—base_routing()function defines defaultsAdditional Information
ClientGetNameAsync(Route route)) onGlideClusterClientare unaffected — those stay as cluster-only methods.