Documentation
¶
Index ¶
- func Setup(ctx context.Context, db *sql.DB) error
- type ID
- type Message
- type NewOpts
- type Queue
- func (q *Queue) Delete(ctx context.Context, id ID) error
- func (q *Queue) Extend(ctx context.Context, id ID, delay time.Duration) error
- func (q *Queue) MaxReceive() int
- func (q *Queue) Receive(ctx context.Context) (*Message, error)
- func (q *Queue) ReceiveAndWait(ctx context.Context, interval time.Duration) (*Message, error)
- func (q *Queue) Send(ctx context.Context, m Message) error
- func (q *Queue) SendAndGetID(ctx context.Context, m Message) (ID, error)
- func (q *Queue) SendTx(ctx context.Context, tx *sql.Tx, m Message) error
- func (q *Queue) Timeout() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func New ¶
New Queue with the given options. Defaults if not given: - Logs are discarded. - Max receive count is 3. - Timeout is five seconds.
func (*Queue) MaxReceive ¶
func (*Queue) ReceiveAndWait ¶
ReceiveAndWait for a Message from the queue, polling at the given interval, until the context is cancelled. If the context is cancelled, the error will be non-nil. See context.Context.Err.
func (*Queue) SendAndGetID ¶
SendAndGetID is like Send, but also returns the message ID, which can be used to interact with the message without receiving it first.
Click to show internal directories.
Click to hide internal directories.