Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Stats ¶ added in v0.7.0
type Stats struct {
executor.Stats
Requeues uint `json:"requeues"` // times the latest execution went back to the queue
Cooldown time.Duration `json:"cooldown"` // what is left of the current RequeueCooldown
}
Stats is what the task's executor reports, plus what the manager adds on top of it.
type Task ¶
type Task struct {
Job job.Job `json:"-"`
Ctx context.Context `json:"-"`
Params any `json:"params"`
Schedule string `json:"schedule"`
// Manual keeps the task registered without running it on its own: only Trigger does.
Manual bool `json:"manual,omitempty"`
Priority int `json:"priority"`
Exclusive bool `json:"exclusive"`
Timeout time.Duration `json:"timeout,omitempty"`
RetryAttempts int `json:"retry_attempts,omitempty"`
RetryDelay time.Duration `json:"retry_delay,omitempty"`
// RequeueAttempts is how many times a failed execution, its retries used
// up, goes back to the queue. Unlike a retry it gives up its worker while
// it waits, and it counts on top: a task runs up to
// (RetryAttempts+1) * (RequeueAttempts+1) times.
RequeueAttempts int `json:"requeue_attempts,omitempty"`
// RequeueCooldown is how long a failed execution waits before going back to
// the queue.
RequeueCooldown time.Duration `json:"requeue_cooldown,omitempty"`
// contains filtered or unexported fields
}
func (*Task) GetPriority ¶
func (*Task) ID ¶ added in v0.7.0
ID is the task's identity, its job's ID; look tasks up by ID only.
func (*Task) IsRequeueing ¶ added in v0.7.0
IsRequeueing reports whether the task failed and is waiting to run again, cooling down or back in the queue. Its job stays failed meanwhile: that run did fail.
func (*Task) SetPriority ¶
Click to show internal directories.
Click to hide internal directories.