Documentation ¶
Index ¶
- func New() mq.Broker
- func NewFinite(finite bool) mq.Broker
- type Acknowledger
- type Broker
- type JobIter
- type Queue
- func (q *Queue) Consume(advertisedWindow int) (mq.JobIter, error)
- func (q *Queue) Publish(j *mq.Job) error
- func (q *Queue) PublishDelayed(j *mq.Job, delay time.Duration) error
- func (q *Queue) RepublishBuried(conditions ...mq.RepublishConditionFunc) error
- func (q *Queue) Transaction(txcb mq.TxCallback) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Acknowledger ¶
type Acknowledger struct {
// contains filtered or unexported fields
}
Acknowledger implements a queue.Acknowledger interface.
func (*Acknowledger) Ack ¶
func (a *Acknowledger) Ack() error
Ack is called when the Job has finished.
func (*Acknowledger) Reject ¶
func (a *Acknowledger) Reject(requeue bool) error
Reject is called when the Job has errored. The argument indicates whether the Job should be put back in queue or not. If requeue is false, the job will go to the buried queue until Queue.RepublishBuried() is called.
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
Broker is a in-memory implementation of Broker.
type Queue ¶
Queue implements a queue.Queue interface.
func (*Queue) Consume ¶
Consume implements Queue. The advertisedWindow value is the maximum number of unacknowledged jobs. Use 0 for an infinite window.
func (*Queue) PublishDelayed ¶
PublishDelayed publishes a Job to the queue with a given delay.
func (*Queue) RepublishBuried ¶
RepublishBuried implements the Queue interface.
func (*Queue) Transaction ¶
Transaction calls the given callback inside a transaction.