Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotRetryable = errors.New("not retryable")
ErrNotRetryable should be returned by the job to avoid retrying it.
Functions ¶
func Retry ¶ added in v0.4.0
func Retry(retries uint) workers.Middleware
Retry is a job middleware that allows to retry a job if it returns an error.
If you consider that the error is not retryable you can either return nil or the custom "ErrNotRetryable".
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter count how many jobs have started and finished. Keep in mind that it's not protected against overflows.
type Elapsed ¶
type Elapsed struct {
Counter
// contains filtered or unexported fields
}
Elapsed is a job middleware that extends the simple counter and calculates the total time, average time and the last time spent doing the job.
Click to show internal directories.
Click to hide internal directories.