Documentation ¶
Index ¶
- func FailRunningJobs(reader domain.JobsReader, writer domain.JobsWriter) func(context.Context, error) error
- func Process(writer domain.JobsWriter, handler domain.Handler) func(context.Context, domain.Job) error
- func Queue(writer domain.JobsWriter, handler domain.Handler) func(context.Context, QueueCommand) error
- type QueueCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailRunningJobs ¶ added in v1.1.0
func FailRunningJobs( reader domain.JobsReader, writer domain.JobsWriter, ) func(context.Context, error) error
Mark all running jobs as failed with the given reason. This is mostly used when the server has crashed or has been hard resetted and some job were processing.
func Process ¶ added in v1.1.0
func Process(writer domain.JobsWriter, handler domain.Handler) func(context.Context, domain.Job) error
Process a single job. Called by async workers that's why there are no command here.
func Queue ¶
func Queue( writer domain.JobsWriter, handler domain.Handler, ) func(context.Context, QueueCommand) error
Types ¶
type QueueCommand ¶
type QueueCommand struct {
Payload any `json:"payload"`
}
Click to show internal directories.
Click to hide internal directories.