Documentation
¶
Index ¶
- func CleanUp()
- func DeactivateHosts(hosts []string, until time.Time) error
- func OnStop(name string)
- func PeriodicWorker(ctx context.Context, name string, work func() error, interval time.Duration)
- func ReportUp(name string)
- func Worker(ctx context.Context, name string, work func(context.Context) error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUp ¶
func CleanUp()
CleanUp deletes all worker statuses that have not been updated in the last 24 hours.
func OnStop ¶
func OnStop(name string)
OnStop reports that a worker has stopped. It should be called in a defer statement for every worker.
func PeriodicWorker ¶
PeriodicWorker is a wrapper for a worker main function and calls it as often as the interval. It will never call a main function more than once at a time, so it might be slower than the interval if the main function takes longer than the interval to run. It is meant to run asynchronously.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.