Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateBackoffForAttempt ¶
CalculateBackoffForAttempt returns the duration for a specific attempt. This is useful if you have a large number of independent Backoffs, but don't want use unnecessary memory storing the Backoff parameters per Backoff. The first attempt should be 0.
ForAttempt is concurrent-safe.
Types ¶
type ExecutionProvider ¶
ExecutionProvider is used for executing cronjobs
type SourceProvider ¶
type SourceProvider interface { Read() error OnTaskUpdate(func(*Task) error) Stop() error TaskStarted(*Task) error TaskDone(*Task) error TaskError(*Task, error) error }
SourceProvider is used to get tasks
type Task ¶
type Task struct { Name string `json:"name"` Running bool `json:"is_running,omitempty"` Expression string `json:"schedule,omitempty"` LastRunAt time.Time `json:"last_run_at,omitempty"` AfterTask string `json:"after_task,omitempty"` Key string `json:"-"` SourceProvider SourceProvider `json:"-"` Executor string `json:"executor"` ExecutionConfig interface{} `json:"execution_config"` LastError string `json:"last_error"` CurrentRetryCount int `json:"current_retry_counter"` MaxRetries int `json:"max_retries"` }
Task represents a task to be run
Click to show internal directories.
Click to hide internal directories.