Documentation
¶
Overview ¶
Package goqite provides the named Queue. It is backed by a SQLite table where the messages are stored.
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) DeleteTx(ctx context.Context, tx *sql.Tx, id ID) error
- func (q *Queue) Extend(ctx context.Context, id ID, delay time.Duration) error
- func (q *Queue) ExtendTx(ctx context.Context, tx *sql.Tx, id ID, delay time.Duration) error
- func (q *Queue) Receive(ctx context.Context) (*Message, error)
- func (q *Queue) ReceiveAndWait(ctx context.Context, interval time.Duration) (*Message, error)
- func (q *Queue) ReceiveTx(ctx context.Context, tx *sql.Tx) (*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) SendAndGetIDTx(ctx context.Context, tx *sql.Tx, m Message) (ID, error)
- func (q *Queue) SendTx(ctx context.Context, tx *sql.Tx, m Message) error
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) 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.
func (*Queue) SendAndGetIDTx ¶
SendAndGetIDTx is like SendAndGetID, but within an existing transaction.
Directories
¶
Path | Synopsis |
---|---|
docs
|
|
Package http provides an HTTP handler for a goqite.Queue.
|
Package http provides an HTTP handler for a goqite.Queue. |
internal
|
|
Package jobs provides a Runner which can run registered job [Func]s by name, when a message for it is received on the underlying queue.
|
Package jobs provides a Runner which can run registered job [Func]s by name, when a message for it is received on the underlying queue. |
Click to show internal directories.
Click to hide internal directories.