Documentation
¶
Index ¶
Constants ¶
View Source
const Forever = -1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
type ID int64
ID represents ID of timer task
func SetIntervalFunc ¶
SetIntervalFunc add a interval timer func
func SetTimeoutFunc ¶
SetTimeoutFunc add a timeout timer func
type Scheduler ¶
type Scheduler interface {
// Start starts the Scheduler
Start() error
// 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.