Documentation
¶
Index ¶
- type QueueItem
- type QueueMetrics
- type TaskQueue
- func (q *TaskQueue) Close()
- func (q *TaskQueue) Dequeue() (*QueueItem, error)
- func (q *TaskQueue) Done(t *tasksv1.Task)
- func (q *TaskQueue) Enqueue(ctx context.Context, item *QueueItem) error
- func (q *TaskQueue) Len() int
- func (q *TaskQueue) Pop() any
- func (q *TaskQueue) Requeue(ctx context.Context, item *QueueItem) error
- type WorkPool
- type WorkPoolOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueueMetrics ¶
type QueueMetrics struct {
ItemsEnqueued atomic.Int64
ItemsDequeued atomic.Int64
ItemsProcessed atomic.Int64
ItemsFailed atomic.Int64
TotalRetries atomic.Int64
CurrentDepth atomic.Int64
}
QueueMetrics tracks performance and operational metrics for the queue
type TaskQueue ¶
type TaskQueue struct {
// contains filtered or unexported fields
}
func NewTaskQueue ¶
NewTaskQueue creates a new unbounded task queue
func (*TaskQueue) Dequeue ¶
Dequeue retrieves and removes a task from the queue Blocks until an item is available or queue is closed
type WorkPool ¶
type WorkPool struct {
// contains filtered or unexported fields
}
func NewPool ¶
func NewPool(queue *TaskQueue, opts ...WorkPoolOption) *WorkPool
type WorkPoolOption ¶
type WorkPoolOption func(*WorkPool)
func WithBackoff ¶
func WithBackoff(min, max time.Duration) WorkPoolOption
func WithLogger ¶
func WithLogger(l logger.Logger) WorkPoolOption
func WithMaxRetries ¶
func WithMaxRetries(n int) WorkPoolOption
func WithMaxWorkers ¶
func WithMaxWorkers(n int) WorkPoolOption
Click to show internal directories.
Click to hide internal directories.