Documentation
¶
Index ¶
Constants ¶
View Source
const Forever = -1
Forever
Variables ¶
This section is empty.
Functions ¶
func ClearInterval ¶
ClearTimeout removes the interval timer by ID
func ClearTimeout ¶
ClearTimeout removes the timeout timer by ID
Types ¶
type ID ¶
type ID int64
ID represents ID of timer task
func SetInterval ¶
SetInterval add interval timer
func SetIntervalFunc ¶
SetIntervalFunc add a interval timer func
func SetTimeout ¶
SetTimeout add a timeout timer
func SetTimeoutFunc ¶
SetTimeoutFunc add a timeout timer func
type Scheduler ¶
type Scheduler interface { // Start starts the Scheduler Start() // Shutdown shutdowns the Scheduler Shutdown() // Add adds a new timer task Add(next, duration time.Duration, task Task, times int) ID // Remove removes a timer task by ID Remove(id ID) }
Scheduler schedules timers
func NewMemoryScheduler ¶
func NewMemoryScheduler() Scheduler
NewMemoryScheduler creates in-memory Scheduler
Click to show internal directories.
Click to hide internal directories.