Documentation ¶
Index ¶
Constants ¶
View Source
const (
Infinite = -1
)
Variables ¶
This section is empty.
Functions ¶
func NewScheduler ¶ added in v1.1.13
func NewScheduler() *scheduler
NewScheduler creates a new TimerScheduler
Types ¶
type Scheduler ¶ added in v1.1.13
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer represents a cron job
func NewCondTimer ¶
func NewCondTimer(condition TimerCondition, fn TimerFunc) *Timer
type TimerCondition ¶
TimerCondition represents a checker that returns true when cron job needs to execute
type TimerFunc ¶
type TimerFunc func()
TimerFunc represents a function which will be called periodically in main logic gorontine.
type TimerManager ¶ added in v1.0.1
type TimerManager interface { NewCountTimer(interval time.Duration, count int, fn TimerFunc) *Timer NewAfterTimer(duration time.Duration, fn TimerFunc) *Timer NewCondTimer(condition TimerCondition, fn TimerFunc) *Timer NewTimer(interval time.Duration, fn TimerFunc) *Timer TaskChan() <-chan Task CloseTimer() }
func NewTimerManager ¶ added in v1.0.1
func NewTimerManager() TimerManager
Click to show internal directories.
Click to hide internal directories.