Documentation
¶
Overview ¶
Package redis provides a Redis-based job queue implementation. This package offers distributed queue operations with blocking dequeue and processing tracking.
Index ¶
- type Config
- type Job
- type Queue
- func (q *Queue) Close() error
- func (q *Queue) CompleteJob(actionID string) error
- func (q *Queue) Dequeue(queueName string, timeout time.Duration) (*Job, error)
- func (q *Queue) Enqueue(job Job) error
- func (q *Queue) FailJob(actionID string, requeue bool, queueName string, retryCount int) error
- func (q *Queue) GetQueueDepth(queueName string) (int, error)
- func (q *Queue) IsProcessing(actionID string) (bool, error)
- func (q *Queue) MarkProcessing(actionID string, deadline time.Time) error
- func (q *Queue) WaitForJobCompletion(actionID string, timeout time.Duration, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
RedisURL string // Redis URL (defaults to WHEN_REDIS_URL or redis://localhost:6379/0)
KeyPrefix string // Key prefix for queue keys (defaults to "queue:")
}
Config configures the Redis queue
type Job ¶
type Job struct {
ActionID string `json:"actionID"`
QueueName string `json:"queueName"`
WorkflowID string `json:"workflowID"` // Workflow ID (determines which queue to use)
RunID string `json:"runID"`
EnqueuedAt time.Time `json:"enqueuedAt"`
RetryCount int `json:"retryCount"`
}
Job represents a job in the execution queue
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue handles job queue operations using Redis
func (*Queue) CompleteJob ¶
CompleteJob removes a job from the processing set
func (*Queue) GetQueueDepth ¶
GetQueueDepth returns the number of jobs in a queue
func (*Queue) IsProcessing ¶
IsProcessing checks if a job is currently being processed
func (*Queue) MarkProcessing ¶
MarkProcessing adds a job to the processing set with a deadline
Click to show internal directories.
Click to hide internal directories.