Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultScheduler ¶
type DefaultScheduler struct{}
DefaultScheduler 无消息队列的任务处理
每个读线程 会同时进行访问 存在并发问题
func NewDefaultScheduler ¶
func NewDefaultScheduler() *DefaultScheduler
func (*DefaultScheduler) Schedule ¶
func (defaultScheduler *DefaultScheduler) Schedule(task Task)
Schedule 每个读线程直接执行
type LocalScheduler ¶
type LocalScheduler interface {
Schedule(Task)
}
LocalScheduler schedules task to a customized goroutine
type QueueLocalScheduler ¶
type QueueLocalScheduler struct {
// contains filtered or unexported fields
}
按会话进行绑定
func NewQueueLocalScheduler ¶
func NewQueueLocalScheduler() *QueueLocalScheduler
QueueLocalScheduler
func (*QueueLocalScheduler) Sched ¶
func (localScheduler *QueueLocalScheduler) Sched()
Sched 消息自定义协程任务
func (*QueueLocalScheduler) Schedule ¶
func (localScheduler *QueueLocalScheduler) Schedule(task Task)
Schedule 读协程往自定义消息队列写入任务
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