Documentation ¶
Overview ¶
Package simpleq provides a super-simple queue backed by Redis
Index ¶
- type Listener
- type Queue
- func (q *Queue) BPop(timeout_secs int) (el []byte, err error)
- func (q *Queue) BPopPipe(q2 *Queue, timeout_secs int) (el []byte, err error)
- func (q *Queue) Clear() (nRemoved int64, err error)
- func (q *Queue) Close() error
- func (q *Queue) List() (elements [][]byte, err error)
- func (q *Queue) Pop() (el []byte, err error)
- func (q *Queue) PopListen() *Listener
- func (q *Queue) PopPipe(q2 *Queue) (el []byte, err error)
- func (q *Queue) PopPipeListen(q2 *Queue) *Listener
- func (q *Queue) Pull(el []byte) (nRemoved int64, err error)
- func (q *Queue) PullPipe(q2 *Queue, el []byte) (lengthQ2 int64, err error)
- func (q *Queue) Push(el []byte) (length int64, err error)
- func (q *Queue) SPullPipe(q2 *Queue, el []byte) (result int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener struct { Elements chan []byte Errors chan error // contains filtered or unexported fields }
A listener on a queue, repeatedly calling BPop or BPopPipe
func NewListener ¶
Create a new listener. Use pipeto as nil to call BPop.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
A super simple redis-backed queue
func (*Queue) BPop ¶
Block and Pop an element off the queue Use timeout_secs = 0 to block indefinitely On timeout, this DOES return an error because redigo does.
func (*Queue) BPopPipe ¶
Block and Pop an element out of a queue and put it in another queue atomically On timeout, this doesn't return an error because redigo doesn't.
func (*Queue) PopPipeListen ¶
Create a listener that calls PopPipe
func (*Queue) PullPipe ¶
Pull an element out of the queue and push it onto another atomically Note: This will push the element regardless of the return value from pull