Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoTask means no pending task is ready for assignment. ErrNoTask = errors.New("no pending task") // ErrTaskNotFound means task ID is not known by scheduler. ErrTaskNotFound = errors.New("task not found") // ErrInvalidState means state transition is not allowed. ErrInvalidState = errors.New("invalid task state transition") )
Functions ¶
This section is empty.
Types ¶
type RetryPolicy ¶
RetryPolicy controls task retry scheduling.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages task queue and retry lifecycle.
func New ¶
func New(retry RetryPolicy) *Scheduler
type Task ¶
type Task struct {
ID string
JobID string
StageID string
Type TaskType
Payload map[string]string
State TaskState
WorkerID string
Attempt int
MaxRetry int
LastError string
CreatedAt time.Time
UpdatedAt time.Time
}
Task is a minimal unit to schedule and retry.
Click to show internal directories.
Click to hide internal directories.