Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// Queue the job should be placed into
Queue string
// Args that will be passed to the Handler when run
Args Args
// Handler that will be run by the worker
Handler string
}
Job to be processed by a Worker
type Worker ¶
type Worker interface {
// Start the worker with the given context
Start(context.Context) error
// Stop the worker
Stop() error
// Perform a job as soon as possibly
Perform(Job) error
// PerformAt performs a job at a particular time
PerformAt(Job, time.Time) error
// PerformIn performs a job after waiting for a specified amount of time
PerformIn(Job, time.Duration) error
// Register a Handler
Register(string, Handler) error
}
Worker interface that needs to be implemented to be considered a "worker"
func NewSimple ¶
func NewSimple() Worker
NewSimple creates a basic implementation of the Worker interface that is backed using just the standard library and goroutines.
func NewSimpleWithContext ¶
NewSimpleWithContext creates a basic implementation of the Worker interface that is backed using just the standard library and goroutines.
Click to show internal directories.
Click to hide internal directories.