Skip to content

Terminology and Concepts

Adriano Caloiaro edited this page Sep 12, 2023 · 1 revision

Handler

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.

Job

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.

Queue

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.

Clone this wiki locally