Documentation
¶
Index ¶
- type Option
- type PriorityQueue
- type Queue
- func (q *Queue) Acknowledge(ackID string) bool
- func (q *Queue) Close() error
- func (q *Queue) Dequeue() (any, bool)
- func (q *Queue) DequeueWithAckId() (any, bool, string)
- func (q *Queue) Enqueue(item any) bool
- func (q *Queue) Len() int
- func (q *Queue) Purge()
- func (q *Queue) RequeueNoAckRows()
- func (q *Queue) Values() []any
- type Queues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Queue)
Option is a function type that can be used to configure a Queue
func WithRemoveOnComplete ¶
WithRemoveOnComplete sets whether acknowledged items should be deleted from the database when true, or just marked as completed when false
type PriorityQueue ¶
type PriorityQueue struct {
*Queue
}
PriorityQueue extends Queue with priority-based dequeuing
func (*PriorityQueue) Dequeue ¶
func (pq *PriorityQueue) Dequeue() (any, bool)
Dequeue overrides the base Dequeue method to use priority-based dequeuing
func (*PriorityQueue) DequeueWithAckId ¶
func (pq *PriorityQueue) DequeueWithAckId() (any, bool, string)
DequeueWithAckId overrides the base DequeueWithAckId method to use priority-based dequeuing
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue implements the Queue interface using SQLite as the storage backend
func (*Queue) Acknowledge ¶
Acknowledge marks an item as completed Returns true if the item was successfully acknowledged, false otherwise
func (*Queue) Dequeue ¶
Dequeue removes and returns the next item from the queue Returns the item and a boolean indicating if the operation was successful
func (*Queue) DequeueWithAckId ¶
DequeueWithAckId removes and returns the next item from the queue with an acknowledgment ID Returns the item, a boolean indicating if the operation was successful, and the acknowledgment ID
func (*Queue) Enqueue ¶
Enqueue adds an item to the queue It serializes the item to JSON and stores it in the database Returns true if the operation was successful
func (*Queue) RequeueNoAckRows ¶ added in v0.2.1
func (q *Queue) RequeueNoAckRows()