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 {