Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CronDaemon ¶
type CronDaemon struct { Job CronJob Ticker *time.Ticker // Blocking means the scheduler does not allow jobs to overlap, there can only be one running at a time. Blocking bool }
CronDaemon is a daemon with an internal scheduler for a CronJob.
func (*CronDaemon) Run ¶
func (d *CronDaemon) Run(quit <-chan struct{}) error
Run implements the Daemon interface.
type CronJob ¶
type CronJob interface { // Run runs the job. Run() error }
CronJob is ran by the CronDaemon.
type Daemon ¶
type Daemon interface { // Run has a loop inside and quits when it gets a signal from the quit channel. // It can handle errors internally or return an error if the daemon can't continue running. // Returning nil means the daemon somehow finished working (eg. received an external signal). Run(quit <-chan struct{}) error }
Daemon is a long-running process in the background.
type Err ¶ added in v0.3.1
type Err <-chan error
Err accepts an error which causes the application to stop.
Click to show internal directories.
Click to hide internal directories.