Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoValidHandlerFound = errors.New("no_valid_handler_found") ErrInvalidPayload = errors.New("invalid_payload") JobDataTypes = storage.NewDiscriminatedMapper[JobData]() )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Prepare(any) (JobData, monad.Maybe[string], error) // Try to prepare a job payload and returns the JobData needed to process it and an eventual dedupe name to use
Process(context.Context, Job) error
}
Represents an object which can handle a specific job.
type Job ¶
func NewJob ¶
Creates a new job which will be processed by a worker later on. A dedupe name can be provided to avoid multiple workers to process the same kind of job at the same time, such as a deployment for the same app and environment. If no dedupe name is given, the job id will be used instead.
type JobData ¶ added in v1.1.0
type JobData storage.Discriminated
type JobsReader ¶
Click to show internal directories.
Click to hide internal directories.