Documentation ¶
Index ¶
- Constants
- func SetTimeTestHandler(handler ITimeTestHandler)
- func Stop()
- type Head
- func (h *Head) Add(new *Head)
- func (h *Head) AddTail(new *Head)
- func (h *Head) Del(head *Head)
- func (h *Head) DelInit(pos *Head)
- func (h *Head) Empty() bool
- func (pos *Head) Entry(offset uintptr) unsafe.Pointer
- func (h *Head) FirstEntry(offset uintptr) unsafe.Pointer
- func (h *Head) FirstEntryOrNil(offset uintptr) unsafe.Pointer
- func (h *Head) ForEach(callback func(pos *Head))
- func (h *Head) ForEachPrev(callback func(pos *Head))
- func (h *Head) ForEachPrevSafe(callback func(pos *Head))
- func (h *Head) ForEachSafe(callback func(pos *Head))
- func (h *Head) Init()
- func (h *Head) IsLast() bool
- func (h *Head) LastEntry(offset uintptr) unsafe.Pointer
- func (h *Head) Len() int
- func (h *Head) Move(list *Head)
- func (h *Head) MoveTail(list *Head)
- func (pos *Head) NextEntry(offset uintptr) unsafe.Pointer
- func (pos *Head) PrevEntry(offset uintptr) unsafe.Pointer
- func (h *Head) Replace(new *Head)
- func (h *Head) ReplaceInit(new *Head)
- func (h *Head) RotateLeft()
- type ITimeTestHandler
- type ITimerData
- type Time
- type TimeEventMsg
- type TimeHandler
- type TimeNoder
- type Timer
- type TimerOption
- type TypeEventChan
Constants ¶
View Source
const ALL_DAY bitset.BitSet = 0b1111111111111111111111111111111
View Source
const ALL_HOUR bitset.BitSet = 0b111111111111
View Source
const ALL_MINUTE bitset.BitSet = 0b111111111111111111111111111111111111111111111111111111111111
View Source
const ALL_MONTH bitset.BitSet = 0b111111111111
View Source
const ALL_SECOND bitset.BitSet = ALL_MINUTE
View Source
const ALL_WEEK bitset.BitSet = 0b1111111
Variables ¶
This section is empty.
Functions ¶
func SetTimeTestHandler ¶ added in v0.2.31
func SetTimeTestHandler(handler ITimeTestHandler)
Types ¶
type Head ¶
func (*Head) ForEachPrev ¶
func (*Head) ForEachPrevSafe ¶
func (*Head) ForEachSafe ¶
func (*Head) ReplaceInit ¶
func (*Head) RotateLeft ¶
func (h *Head) RotateLeft()
type ITimeTestHandler ¶ added in v0.2.31
type ITimerData ¶ added in v0.2.30
type ITimerData interface {
Restore()
}
type Time ¶
先使用sync.Mutex实现功能 后面使用cas优化
func (*Time) GetCallback ¶ added in v0.2.30
func (this *Time) GetCallback() func(TimeNoder)
func (*Time) GetInterval ¶ added in v0.2.19
type TimeEventMsg ¶ added in v0.2.14
type TimeHandler ¶ added in v0.2.14
type TimeHandler interface { EventChan() <-chan TypeEventChan After(delay time.Duration, cb func(TimeNoder)) TimeNoder Schedule(interval time.Duration, cb func(TimeNoder), opts ...TimerOption) TimeNoder Cron(second, minute, hour, day, month, weekday interface{}, cb func(TimeNoder)) TimeNoder At(t time.Time, cb func(TimeNoder)) TimeNoder // 停止所有定时器 StopTimer() // 删除handler DelTimer() PrintDebug() }
func NewHandler ¶ added in v0.2.15
func NewHandler() TimeHandler
type TimeNoder ¶
type TimeNoder interface { Stop() GetCallback() func(TimeNoder) GetDelay() time.Duration GetInterval() time.Duration }
停止单个定时器
type TimerOption ¶ added in v0.2.26
type TimerOption func(node *timeNode)
func WithDelay ¶ added in v0.2.26
func WithDelay(delay time.Duration) TimerOption
func WithLoop ¶ added in v0.2.26
func WithLoop(loop uint64) TimerOption
type TypeEventChan ¶ added in v0.2.14
type TypeEventChan interface{}
type TypeEventChan func(...interface{})
Click to show internal directories.
Click to hide internal directories.