MCPcopy
hub / github.com/redis/go-redis / executeOnArbitraryNode

Method executeOnArbitraryNode

osscluster_router.go:73–79  ·  view source on GitHub ↗

executeOnArbitraryNode routes command to an arbitrary node

(ctx context.Context, cmd Cmder)

Source from the content-addressed store, hash-verified

71
72// executeOnArbitraryNode routes command to an arbitrary node
73func (c *ClusterClient) executeOnArbitraryNode(ctx context.Context, cmd Cmder) error {
74 node := c.pickArbitraryNode(ctx)
75 if node == nil {
76 return errClusterNoNodes
77 }
78 return node.Client.Process(ctx, cmd)
79}
80
81// executeOnAllNodes executes command on all nodes (masters and replicas)
82func (c *ClusterClient) executeOnAllNodes(ctx context.Context, cmd Cmder, policy *routing.CommandPolicy) error {

Callers 1

executeDefaultMethod · 0.95

Calls 2

pickArbitraryNodeMethod · 0.95
ProcessMethod · 0.65

Tested by

no test coverage detected