Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskManager ¶
type TaskManager struct { Log *logrus.Entry Tr *i18n.TranslationSet // contains filtered or unexported fields }
func NewTaskManager ¶
func NewTaskManager(log *logrus.Entry, translationSet *i18n.TranslationSet) *TaskManager
func (*TaskManager) Close ¶ added in v0.7.2
func (t *TaskManager) Close()
Close closes the task manager, killing whatever task may currently be running
func (*TaskManager) NewTickerTask ¶
func (t *TaskManager) NewTickerTask(duration time.Duration, before func(ctx context.Context), f func(ctx context.Context, notifyStopped chan struct{})) error
NewTickerTask is a convenience function for making a new task that repeats some action once per e.g. second the before function gets called after the lock is obtained, but before the ticker starts. if you handle a message on the stop channel in f() you need to send a message on the notifyStopped channel because returning is not sufficient. Here, unlike in a regular task, simply returning means we're now going to wait till the next tick to run again.
Click to show internal directories.
Click to hide internal directories.