From 012cb08670f122e85a404200b328ddbab51a29aa Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Mon, 26 Sep 2016 15:51:47 -0700 Subject: [PATCH] peekpipeline --- redcon.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/redcon.go b/redcon.go index 0921385..dbc8a20 100644 --- a/redcon.go +++ b/redcon.go @@ -81,7 +81,11 @@ type Conn interface { // }() Detach() DetachedConn // ReadPipeline returns all commands in current pipeline, if any + // The commands are removed from the pipeline. ReadPipeline() []Command + // ReadPipeline returns all commands in current pipeline, if any. + // The commands remain in the pipeline. + PeekPipeline() []Command } // NewServer returns a new Redcon server. @@ -278,6 +282,9 @@ func (c *conn) ReadPipeline() []Command { c.cmds = nil return cmds } +func (c *conn) PeekPipeline() []Command { + return c.cmds +} // DetachedConn represents a connection that is detached from the server type DetachedConn interface {