peekpipeline

This commit is contained in:
Josh Baker 2016-09-26 15:51:47 -07:00
parent ffebbd588e
commit 012cb08670
1 changed files with 7 additions and 0 deletions

View File

@ -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 {