mediocregopher / radix.v2

Redis client for Go
http://godoc.org/github.com/mediocregopher/radix.v2
MIT License
433 stars 92 forks source link

does it support pipeline in cluster mode? #65

Closed justme9527 closed 7 years ago

justme9527 commented 7 years ago

does it support pipeline in cluster mode?

mediocregopher commented 7 years ago

In a sense yes. If you use the GetForKey method on Cluster it will return a Client, and you can do whatever you like to that Client before you Put it back. This includes the normal Pipeline commands (PipeAppend, PipeResp).

However note that if the cluster topology changes while you "own" the Client (i.e. before you Put it back) your pipeline may return related errors like MOVED or ASK, which would normally be handled automatically by Cluster's Cmd method, but in this case won't be. You'll just have to try your pipeline again with another Client and hope the topology has figured itself out.