1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-12 14:21:52 +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

@ -1,9 +1,8 @@
package redis
// Pipeline implements pipelining as described in
// http://redis.io/topics/pipelining.
//
// Pipeline is not thread-safe.
// http://redis.io/topics/pipelining. It's NOT safe for concurrent use
// by multiple goroutines.
type Pipeline struct {
commandable
@ -36,6 +35,7 @@ func (pipe *Pipeline) process(cmd Cmder) {
pipe.cmds = append(pipe.cmds, cmd)
}
// Close closes the pipeline, releasing any open resources.
func (pipe *Pipeline) Close() error {
pipe.Discard()
pipe.closed = true