Documentation ¶
Index ¶
- Constants
- type Item
- type Timer
- type TimerGroup
- func (tg *TimerGroup) After(timeout time.Duration) <-chan time.Time
- func (tg *TimerGroup) AfterFunc(timeout time.Duration, f func()) *Item
- func (tg *TimerGroup) Async(f func())
- func (tg *TimerGroup) NextIndex() uint32
- func (tg *TimerGroup) NextTimer() *Timer
- func (tg *TimerGroup) Start()
- func (tg *TimerGroup) Stop()
Constants ¶
View Source
const (
TimeForever = time.Duration(math.MaxInt64)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item is a heap timer item.
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
type TimerGroup ¶
type TimerGroup struct {
// contains filtered or unexported fields
}
func NewGroup ¶
func NewGroup(name string, size int, executor func(f func())) *TimerGroup
NewGroup creates a TimerGroup.
func (*TimerGroup) After ¶
func (tg *TimerGroup) After(timeout time.Duration) <-chan time.Time
After used as time.After.
func (*TimerGroup) AfterFunc ¶
func (tg *TimerGroup) AfterFunc(timeout time.Duration, f func()) *Item
AfterFunc used as time.AfterFunc.
func (*TimerGroup) Async ¶
func (tg *TimerGroup) Async(f func())
Async executes f in another goroutine.
func (*TimerGroup) NextIndex ¶
func (tg *TimerGroup) NextIndex() uint32
NextIndex returns next timer index.
func (*TimerGroup) NextTimer ¶
func (tg *TimerGroup) NextTimer() *Timer
NextTimer returns next timer.
Click to show internal directories.
Click to hide internal directories.