Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Scheduling ¶ added in v0.6.5
func Scheduling()
Types ¶
type ILocalScheduler ¶ added in v0.6.5
type ILocalScheduler interface {
Schedule(Task)
Close()
}
ILocalScheduler schedules task to a customized goroutine
func NewLocalScheduler ¶ added in v0.6.5
func NewLocalScheduler(cap int) ILocalScheduler
type LocalScheduler ¶
type LocalScheduler struct {
// contains filtered or unexported fields
}
func (*LocalScheduler) Close ¶ added in v0.6.3
func (us *LocalScheduler) Close()
func (*LocalScheduler) Schedule ¶
func (us *LocalScheduler) Schedule(task Task)
func (*LocalScheduler) Scheduling ¶ added in v0.6.5
func (us *LocalScheduler) Scheduling()
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer represents a cron job
func NewAfterTimer ¶
NewAfterTimer returns a new Timer containing a function that will be called after duration that specified by the duration argument. The duration d must be greater than zero; if not, NewAfterTimer will panic. Stop the timer to release associated resources.
func NewCondTimer ¶
func NewCondTimer(condition TimerCondition, fn TimerFunc) *Timer
NewCondTimer returns a new Timer containing a function that will be called when condition satisfied that specified by the condition argument. The duration d must be greater than zero; if not, NewCondTimer will panic. Stop the timer to release associated resources.
func NewCountTimer ¶
NewCountTimer returns a new Timer containing a function that will be called with a period specified by the duration argument. After count times, timer will be stopped automatically, It adjusts the intervals for slow receivers. The duration d must be greater than zero; if not, NewCountTimer will panic. Stop the timer to release associated resources.
func NewTimer ¶
NewTimer returns a new Timer containing a function that will be called with a period specified by the duration argument. It adjusts the intervals for slow receivers. The duration d must be greater than zero; if not, NewTimer will panic. Stop the timer to release associated resources.
type TimerCondition ¶
TimerCondition represents a checker that returns true when cron job needs to execute