Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpBackoff ¶
type ExpBackoff struct {
// contains filtered or unexported fields
}
ExpBackoff is used as delayer, implements exponential backoff algorithm
func NewExpBackoff ¶
func NewExpBackoff(base int) *ExpBackoff
NewExpBackoff returns pointer to new ExpBackoff base is meant to be seconds
type TimeTracker ¶
type TimeTracker struct {
// contains filtered or unexported fields
}
TimeTracker is used to keep track of something
func NewTracker ¶
func NewTracker(delayer Delayer) *TimeTracker
NewTracker returns pointer to new TimeTracker and sets its Delayer
func (*TimeTracker) HasBeenRan ¶
func (t *TimeTracker) HasBeenRan() bool
HasBeenRan checks how many times has time delayer and returns true if ever ran
func (*TimeTracker) IsReady ¶
func (t *TimeTracker) IsReady() bool
IsReady checks if current time is after nextTime On first check before calling SetNext, always true due to nextTime having zero value
Click to show internal directories.
Click to hide internal directories.