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

pipeline: Add DiscardQueued method.

This commit is contained in:
Vladimir Mihailenco
2012-08-19 23:19:00 +03:00
parent 569b1b07ac
commit a654224ced
2 changed files with 20 additions and 0 deletions

View File

@ -30,6 +30,12 @@ func (c *PipelineClient) Close() error {
return nil
}
func (c *PipelineClient) DiscardQueued() {
c.mtx.Lock()
c.reqs = c.reqs[:0]
c.mtx.Unlock()
}
func (c *PipelineClient) RunQueued() ([]Req, error) {
c.mtx.Lock()
if len(c.reqs) == 0 {