Documentation
¶
Index ¶
- Constants
- type BatchJob
- type DBTime
- type Job
- type JobFromNotification
- type NextIntervalFunc
- type OnError
- type Options
- type Parameters
- func (r Parameters) Marshal() ([]byte, error)
- func (c *Parameters) Scan(value interface{}) error
- func (r *Parameters) ToInterfaceSlice() []interface{}
- func (r *Parameters) ToReflectValues() []reflect.Value
- func (r *Parameters) Unmarshal(value interface{}) error
- func (c Parameters) Value() (driver.Value, error)
- type Schedule
- type Task
- type Worker
Constants ¶
View Source
const ( // Job statuses before processing JobStatusQueued = "QUEUED" JobStatusScheduled = "SCHEDULED" // Running status is used when the job is being processed by a worker. JobStatusRunning = "RUNNING" // Job statuses after processing JobStatusFailed = "FAILED" JobStatusSucceeded = "SUCCEEDED" JobStatusCancelled = "CANCELLED" )
View Source
const ( RETRY_BACKOFF_NONE = "none" RETRY_BACKOFF_LINEAR = "linear" RETRY_BACKOFF_EXPONENTIAL = "exponential" )
View Source
const ( WorkerStatusRunning = "RUNNING" WorkerStatusFailed = "FAILED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
ID int `json:"id"`
RID uuid.UUID `json:"rid"`
WorkerID int `json:"worker_id"`
WorkerRID uuid.UUID `json:"worker_rid"`
Options *Options `json:"options"`
TaskName string `json:"task_name"`
Parameters Parameters `json:"parameters"`
Status string `json:"status"`
ScheduledAt *time.Time `json:"scheduled_at"`
StartedAt *time.Time `json:"started_at"`
ScheduleCount int `json:"schedule_count"`
Attempts int `json:"attempts"`
Results Parameters `json:"result"`
Error string `json:"error"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type JobFromNotification ¶
type JobFromNotification struct {
ID int `json:"id"`
RID uuid.UUID `json:"rid"`
WorkerID int `json:"worker_id"`
WorkerRID uuid.UUID `json:"worker_rid"`
Options *Options `json:"options"`
TaskName string `json:"task_name"`
Parameters Parameters `json:"parameters"`
Status string `json:"status"`
ScheduledAt DBTime `json:"scheduled_at"`
StartedAt DBTime `json:"started_at"`
Attempts int `json:"attempts"`
Results Parameters `json:"result"`
Error string `json:"error"`
CreatedAt DBTime `json:"created_at"`
UpdatedAt DBTime `json:"updated_at"`
}
func (*JobFromNotification) ToJob ¶
func (jn *JobFromNotification) ToJob() *Job
type NextIntervalFunc ¶
NextIntervalFunc defines a function type that calculates the next interval based on the start time and the current count of executions.
type OnError ¶
type Options ¶
type Parameters ¶
type Parameters []interface{}
func (Parameters) Marshal ¶
func (r Parameters) Marshal() ([]byte, error)
func (*Parameters) Scan ¶
func (c *Parameters) Scan(value interface{}) error
func (*Parameters) ToInterfaceSlice ¶
func (r *Parameters) ToInterfaceSlice() []interface{}
func (*Parameters) ToReflectValues ¶
func (r *Parameters) ToReflectValues() []reflect.Value
func (*Parameters) Unmarshal ¶
func (r *Parameters) Unmarshal(value interface{}) error
type Schedule ¶
type Task ¶
type Task struct {
Task interface{}
Name string
InputParameters []reflect.Type
OutputParameters []reflect.Type
}
func NewTaskWithName ¶
type Worker ¶
type Worker struct {
ID int `json:"id"`
RID uuid.UUID `json:"rid"`
Name string `json:"name"`
Options *OnError `json:"options,omitempty"`
MaxConcurrency int `json:"max_concurrency"`
AvailableTasks []string `json:"available_tasks,omitempty"`
AvailableNextIntervalFuncs []string `json:"available_next_interval,omitempty"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.