-
Notifications
You must be signed in to change notification settings - Fork 4
Terminology and Concepts
Handlers are any code that implement handler.Func
and process Jobs on Queues. In short, they are functions that accept a context.Context
and return error
and they run when a Job is ready to be handled.
Jobs are units of work that are handled by Handlers
. Jobs primarily consist of a Payload, and other job metadata.
Jobs are placed on queues to be processed by a single Handler
, creating a 1:1 mapping between Queues
and Handlerss
.
For "pipeline" use cases, Handlers
may enqueue new Jobs
onto additional Queues
for further processing. E.g. for an image upload service, one might want to enqueue a job to transcode images to multiple formats upon upload. And each transcoding job may enqueue new jobs to save each transcoded image to permanent storage.
Queues are names given to a collection of Jobs
that are handled by Handlers
. Multiple jobs may be added to Queues
, but Queues are associated with a single Handler
.