Documentation ¶
Overview ¶
Package pqueue implements persistent queues.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmpty = errors.New("empty queue")
Functions ¶
This section is empty.
Types ¶
type PQueue ¶
type PQueue struct {
// contains filtered or unexported fields
}
PQueue represents a persistent FIFO queue.
func New ¶
New returns a new PQueue instance with the given name. When a queue with that name already exists in the DB, it will be re-used.
func (*PQueue) Get ¶
Get returns an item from the queue. If the queue is empty it will block until there is a new item in the queue.
func (*PQueue) GetNoWait ¶
GetNoWait return an item from the queue. When the queue is empty it returns the ErrEmpty error.
func (*PQueue) GetWithContext ¶
GetWithContext returns an item from the queue. If the queue is empty it will block until there is a new item in the queue or the context is canceled.
Click to show internal directories.
Click to hide internal directories.