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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user