Documentation
¶
Index ¶
- Constants
- Variables
- type Job
- func (j Job) ParseArguments(dest interface{}) error
- func (j Job) ScheduleRetry(t time.Time) Job
- func (j Job) SetArguments(args interface{}) (Job, error)
- func (j Job) SetLastError(err error) Job
- func (j Job) SetResult(res interface{}) (Job, error)
- func (j Job) SetStatus(status string) Job
- func (j Job) ShouldRetry() bool
- type Options
Constants ¶
View Source
const ( // StatusCompleted is the status of a job that has been completed StatusCompleted = "completed" // StatusScheduled is the status of a job that has been scheduled StatusScheduled = "scheduled" // StatusFailed is the status of a job that has failed StatusFailed = "failed" // StatusCanceled is the status of a job that has been canceled StatusCanceled = "canceled" // StatusInitialized is the status of a job that is currently being processed StatusInitialized = "initialized" )
Variables ¶
View Source
var ( // // ErrNoJobsAvailable is returned when no jobs are available // ErrNoJobsAvailable = errors.New("no jobs available") // ErrJobNotFound is returned when no job is found ErrJobNotFound = errors.New("job not found") )
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { ID string `json:"id"` Queue string `json:"queue"` Status string `json:"status"` Arguments json.RawMessage `json:"arguments"` Result json.RawMessage `json:"result"` LastError string `json:"last_error"` RetryCount int `json:"retry_count"` Options Options `json:"options"` ScheduledAt time.Time `json:"scheduled_at,omitempty"` StartedAt time.Time `json:"started_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Job could use generics for params and result
func (Job) ParseArguments ¶
func (Job) SetArguments ¶
SetArguments sets the arguments of the job
func (Job) SetLastError ¶
SetLastError sets the last error of the job
func (Job) ShouldRetry ¶
Click to show internal directories.
Click to hide internal directories.