Documentation
¶
Index ¶
Constants ¶
const (
DefaultRequeueAfter = 5 * time.Second
)
Variables ¶
var ErrWait = errors.New("wait until some changes are watched")
Functions ¶
func IsWaitError ¶
Types ¶
type AggregateResult ¶
type AggregateResult interface {
Result
// contains filtered or unexported methods
}
type NamedResult ¶
type NamedResult interface {
Result
// contains filtered or unexported methods
}
type Task ¶
type Task interface {
// contains filtered or unexported methods
}
Task is a Syncer wrapper, which can be orchestrated using control structures such as if and break for conditional logic and flow control. Task can only be implemented by this package and users should implement the Syncer interface and wrap Syncers as Tasks
func NameTaskFunc ¶
type TaskReporter ¶
func NewTableTaskReporter ¶
func NewTableTaskReporter(id string) TaskReporter
type TaskRunner ¶
TaskRunner is an executor to run a series of tasks sequentially
func NewTaskRunner ¶
func NewTaskRunner(reporter TaskReporter, ts ...Task) TaskRunner
NewTaskRunner creates a TaskRunner with the given reporter and tasks. There are four status of tasks - Complete: means this task is complete and all is expected - Failed: means an err occurred - Retry: means this task need to wait an interval and retry - Wait: means this task will wait for next event trigger And three results of reconiling 1. A task is failed, return err and wait with backoff 2. Some tasks need retry and max interval is 0, requeue directly with backoff 3. Some tasks need retry and max interval is higher than MinRequeueAfter, requeue after the max interval without backoff 4. All tasks are complete or wait, the key will not be re-added
type WithMessage ¶
WithMessage defines an interface to set message into task result
func Complete ¶
func Complete() WithMessage
Complete means complete the current task and run the next one
func Retry ¶
func Retry(dur time.Duration) WithMessage
Retry means continue all next tasks and retry after dur
func Wait ¶
func Wait() WithMessage
Wait means continue all next tasks and wait until next event triggers task run