Closed awdrius closed 8 years ago
Sorry, was looking for a label to apply.
Hi awdrius! The main redis package is not threadsafe, a single *redis.Client
is simply a wrapper around a net.Conn
with no additional locking. If you wish to share connections amongst multiple go-routines I recommend looking at radix's pool package. If your use-case is super simple, like a one-off script, a sync.Mutex
around a single *redis.Client
may also suffice.
Hopefully this answers your question :)
Yeap, it's what I was wondering about. I'm using cluster connection so I think I'm just going to deal with it myself. Thanks @mediocregopher
Hi @mediocregopher, thanks for a nice redis package for go.
A quick question I have is about how well radix.v2 plays with goroutines. Should I do extensive tests and/or add locking around Cmd() calls?