Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrChildAlreadyAdded = errors.New("child already added")
ErrChildAlreadyAdded error on adding already added child
View Source
var ErrNotChild = errors.New("adding non required child")
ErrNotChild error on adding a child task that not requires the task
Functions ¶
Types ¶
type DoFunc ¶
DoFunc is task payload processing function. If DoFunc returns not nil value and there are no error the value will be saved in context as value with task.ID as key.
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result describes task execution result
type Status ¶
type Status string
Status is task status
const ( // StatusNew status of new task StatusNew Status = "NEW" // StatusWaiting status of task waiting for required tasks completion StatusWaiting Status = "WAITING" // StatusRunning status of executing task StatusRunning Status = "RUNNING" // StatusReady status of successfully executed task StatusReady Status = "READY" // StatusCancelled status of cancelled task StatusCancelled Status = "CANCELLED" // StatusError status of task executed with error StatusError Status = "ERROR" )
type Task ¶
type Task struct { sync.Mutex // UUID is storage specific identifier UUID uuid.UUID // ID is human readable unique per graph task identifier ID ID // Status is task status Status Status // Requires is map of tasks required for the task execution Requires map[ID]bool // Payload is task payload Payload interface{} // DoResult is result of task execution DoResult []byte // DoError is error of task execution DoError error // UndoResult is result of task revert UndoResult []byte // UndoError is error of task revert UndoError error // RequiredFor is map of tasks requires the task execution RequiredFor map[ID]bool // contains filtered or unexported fields }
Task describes task structure
Click to show internal directories.
Click to hide internal directories.