Documentation ¶
Overview ¶
Package periodiccaller allows periodic calls of functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start starts a timer that calls <callback> every <interval> until the <ctx> is canceled.
func StartWithJitter ¶
func StartWithJitter(ctx context.Context, baseDuration time.Duration, jitter float64, callback func()) func()
StartWithJitter starts a timer that calls <callback> every <baseDuration+jitter> until the <ctx> is canceled. <jitter>, [0..1], is used to add +/- jitter to <baseDuration> at every iteration of the timer.
func StartWithManualTrigger ¶
func StartWithManualTrigger(ctx context.Context, interval time.Duration, trigger chan bool, callback func(manualTrigger bool)) func()
StartWithManualTrigger starts a timer that calls <callback> every <interval> from <reset> channel until the <ctx> is canceled. Additionally the 'trigger' channel can be used to trigger callback immediately.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.