Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPopInterval = time.Minute DefaultConcurrency = 5 DefaultCleanupInterval = time.Hour MaximumAttempts = 100 )
Variables ¶
View Source
var GlobalRegistry = &Registry{}
A default registry that other packages can easily register their types against.
View Source
var MaxCoolOffDuration = 240 * time.Second
Functions ¶
func RegisterHandler ¶
func RegisterHandler(jobType string, h interface{})
Register a job and handler with the default registry.
func RegisterPeriodicJob ¶
Types ¶
type Injector ¶
type Injector struct {
// contains filtered or unexported fields
}
func (*Injector) AddPeriodicJob ¶
func (*Injector) AddPeriodicJobRaw ¶
type Job ¶
type PeriodicJob ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) PrintHandlers ¶
func (r *Registry) PrintHandlers(L hclog.Logger)
type RunningJob ¶
type RunningJob struct { Job L hclog.Logger // contains filtered or unexported fields }
func (*RunningJob) Abort ¶
func (r *RunningJob) Abort() error
func (*RunningJob) AbortAndRequeue ¶
func (r *RunningJob) AbortAndRequeue() error
func (*RunningJob) Close ¶
func (r *RunningJob) Close() error
type Worker ¶
type Worker struct { L hclog.Logger Validate func(job *Job) (bool, error) Stats struct { ListenWakeups int64 } // contains filtered or unexported fields }
func (*Worker) CheckPeriodic ¶
func (*Worker) CleanupFinished ¶
Cleanup all the finished jobs
func (*Worker) Pop ¶
func (w *Worker) Pop() (*RunningJob, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.