1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Support custom command in pipeline

This commit is contained in:
Vladimir Mihailenco
2019-02-08 13:22:46 +02:00
parent 228e43ba24
commit 5240e1403a
2 changed files with 13 additions and 0 deletions

View File

@ -31,6 +31,12 @@ type Pipeline struct {
closed bool
}
func (c *Pipeline) Do(args ...interface{}) *Cmd {
cmd := NewCmd(args...)
_ = c.Process(cmd)
return cmd
}
// Process queues the cmd for later execution.
func (c *Pipeline) Process(cmd Cmder) error {
c.mu.Lock()