Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job interface { ID() int64 // Returns the job's ID Do() // Actually executes the job }
Job should be implemented by any struct intended for queueing
type Queue ¶
Queue is set of Jobs that can be worked on by one or more Workers
func CreateQueue ¶
CreateQueue initializes and returns an empty queue
type QueueI ¶
type QueueI interface { Pop() *Job // Remove a job from the queue and return it Push(job *Job) // Add a job onto the queue Jobs() int // Returns the number of jobs on the queue Process(ctx context.Context, pool []*Worker) // Process the queue with a pool of workers }
QueueI is intended for possible future expansion
Click to show internal directories.
Click to hide internal directories.