Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunFunction ¶
RunFunction is a function type that represents the function to be executed by the Runner.
It will be called with the frequency at which the function is executed.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func New ¶
func New(fn RunFunction, schedules []Schedule) (*Runner, error)
New creates a new runner that will execute fn as defined by the provided schedules
Each Schedule in schedules defines how often fn should be executed at any given point in time.
func (*Runner) Restart ¶ added in v2.1.0
func (r *Runner) Restart()
Restart will stop the current schedule and start from the first one defined.
type Schedule ¶ added in v2.1.0
type Schedule struct { // StartDelay is when the function will start executing at a certain frequency StartDelay time.Duration // Frequency configures how often the function will be executed during this Schedule Frequency time.Duration }
Schedule configures when and how frequent the Runner will execute the function
Click to show internal directories.
Click to hide internal directories.