Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job interface { // SetQueueable sets the queueable wrapper of the job SetQueueable(Queueable) // GetQueueable returns the queueable wrapper of the job GetQueueable() Queueable // GetDelay returns the delay of the job GetDelay() time.Duration // GetMaxAttempts returns the max count of attempts allowed of the job GetMaxAttempts() int // GetRetryDelay returns the delay between retries of the job GetRetryDelay() time.Duration // Handle handles the job Handle() error // Failed notifies the job that it has failed Failed(error) }
Job is a job interface
type Queue ¶
type Queue interface { // Name returns the queue name Name() string // Empty returns true if the queue is empty Empty() bool // Count returns the number of jobs in the queue Count() int64 // Enqueue adds a job to the queue and returns the job ID Enqueue(job Job) (Job, bool) // Dequeue dequeues a job from the queue and returns the job Dequeue() (Job, bool) // Remove removes a job from the queue by ID Remove(job Job) // Ack acknowledges a job Ack(job Job) // Release releases a job back to the queue Release(job Job) }
Queue is a queue interface
type Queueable ¶
type Queueable interface { // GetID returns the job ID GetID() string // GetQueue returns the job queue GetQueue() string // GetPayload returns the job payload GetPayload() Job // GetAttempts returns how many times the job has been attempted GetAttempts() int }
Queueable is a queueable interface, it is used to wrap a job
Click to show internal directories.
Click to hide internal directories.