Documentation
¶
Index ¶
- func SetGlobalDelayQueue(queue *DelayQueue) error
- type DelayQueue
- func (queue *DelayQueue) Begin()
- func (queue *DelayQueue) End()
- func (queue *DelayQueue) EndNow()
- func (queue *DelayQueue) Join()
- func (queue *DelayQueue) Len() int
- func (queue *DelayQueue) Push(item *Task)
- func (queue *DelayQueue) PushPeriodTask(item *Task, period string) error
- func (queue *DelayQueue) Run()
- func (queue *DelayQueue) SetMaxLen(maxLen int)
- func (queue *DelayQueue) Top() (*Task, bool)
- func (queue *DelayQueue) TryPush(item *Task) bool
- func (queue *DelayQueue) TryPushPeriodTask(item *Task, period string) (error, bool)
- type Heap
- type HeapBase
- type PeriodTask
- type SyncHeap
- func (syncHeap *SyncHeap) Join()
- func (syncHeap *SyncHeap) Len() int
- func (syncHeap *SyncHeap) Push(item interface{})
- func (syncHeap *SyncHeap) Remove() (interface{}, bool)
- func (syncHeap *SyncHeap) SetMaxLen(maxLen int)
- func (syncHeap *SyncHeap) TaskDone()
- func (syncHeap *SyncHeap) Top() (interface{}, bool)
- func (syncHeap *SyncHeap) TryPush(item interface{}) bool
- func (syncHeap *SyncHeap) TryRemove() (interface{}, bool)
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobalDelayQueue ¶
func SetGlobalDelayQueue(queue *DelayQueue) error
Types ¶
type DelayQueue ¶
type DelayQueue struct {
// contains filtered or unexported fields
}
func GlobalDelayQueue ¶
func GlobalDelayQueue() *DelayQueue
func NewDelayQueue ¶
func NewDelayQueue() *DelayQueue
func (*DelayQueue) Begin ¶
func (queue *DelayQueue) Begin()
func (*DelayQueue) End ¶
func (queue *DelayQueue) End()
func (*DelayQueue) EndNow ¶
func (queue *DelayQueue) EndNow()
func (*DelayQueue) Join ¶
func (queue *DelayQueue) Join()
func (*DelayQueue) Len ¶
func (queue *DelayQueue) Len() int
func (*DelayQueue) Push ¶
func (queue *DelayQueue) Push(item *Task)
func (*DelayQueue) PushPeriodTask ¶
func (queue *DelayQueue) PushPeriodTask(item *Task, period string) error
func (*DelayQueue) Run ¶
func (queue *DelayQueue) Run()
func (*DelayQueue) SetMaxLen ¶
func (queue *DelayQueue) SetMaxLen(maxLen int)
func (*DelayQueue) Top ¶
func (queue *DelayQueue) Top() (*Task, bool)
func (*DelayQueue) TryPush ¶
func (queue *DelayQueue) TryPush(item *Task) bool
func (*DelayQueue) TryPushPeriodTask ¶
func (queue *DelayQueue) TryPushPeriodTask(item *Task, period string) (error, bool)
type HeapBase ¶
type HeapBase struct {
// contains filtered or unexported fields
}
func NewHeapBase ¶
type PeriodTask ¶
type PeriodTask struct { Queue *DelayQueue Schedule cron.Schedule RawData interface{} RawCallBack func(interface{}) Period string }
func (*PeriodTask) GetNextRunUnixNano ¶
func (t *PeriodTask) GetNextRunUnixNano() int64
type SyncHeap ¶
type SyncHeap struct {
// contains filtered or unexported fields
}
func NewSyncHeap ¶
type Task ¶
type Task struct { RunUnixNano int64 Data interface{} CallBack func(interface{}) }
func GetPeriodTask ¶
func GetPeriodTask(queue *DelayQueue, period string, task *Task) (*Task, error)
Click to show internal directories.
Click to hide internal directories.