Documentation
¶
Index ¶
Constants ¶
View Source
const ( // WAITING the job is waiting WAITING = iota + 1 // RUNNING the job is running RUNNING // SUCCESS the job is success SUCCESS // FAILURE the job is failure FAILURE )
Variables ¶
View Source
var TaskHandlers = map[string]process.Handler{
"add": processTaskAdd,
"progress": processTaskProgress,
"get": processTaskGet,
}
TaskHandlers task process handlers
View Source
var Tasks = map[string]*Task{}
Tasks the registered tasks
Functions ¶
Types ¶
type Handlers ¶
type Handlers struct {
Exec func(int, ...interface{}) (interface{}, error)
Progress func(int, int, int, string)
NextID func() (int, error)
Add func(int)
Success func(int, interface{})
Error func(int, error)
}
Handlers the event handlers
type Option ¶
type Option struct {
Name string
JobQueueLength int
WorkerNums int
AttemptAfter int
Attempts int
Timeout int
}
Option the task option
type ProcessOption ¶ added in v0.10.3
type ProcessOption struct {
Name string `json:"name"`
Process string `json:"process"`
Size interface{} `json:"size,omitempty"`
WorkerNums interface{} `json:"worker_nums,omitempty"`
AttemptAfter interface{} `json:"attempt_after,omitempty"`
Attempts interface{} `json:"attempts,omitempty"`
Timeout interface{} `json:"timeout,omitempty"`
Event struct {
Next string `json:"next,omitempty"`
Add string `json:"add,omitempty"`
Success string `json:"success,omitempty"`
Error string `json:"error,omitempty"`
Progress string `json:"progress,omitempty"`
} `json:"event"`
}
ProcessOption the task process option
Click to show internal directories.
Click to hide internal directories.