1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Clarify thread safety. Fixes #166.

This commit is contained in:
Vladimir Mihailenco
2015-09-12 09:36:03 +03:00
parent 02154c3b3a
commit c809246d8b
8 changed files with 33 additions and 16 deletions

View File

@ -10,7 +10,8 @@ type ClusterPipeline struct {
}
// Pipeline creates a new pipeline which is able to execute commands
// against multiple shards.
// against multiple shards. It's NOT safe for concurrent use by
// multiple goroutines.
func (c *ClusterClient) Pipeline() *ClusterPipeline {
pipe := &ClusterPipeline{
cluster: c,
@ -82,7 +83,7 @@ func (pipe *ClusterPipeline) Exec() (cmds []Cmder, retErr error) {
return cmds, retErr
}
// Close marks the pipeline as closed
// Close closes the pipeline, releasing any open resources.
func (pipe *ClusterPipeline) Close() error {
pipe.Discard()
pipe.closed = true