Documentation ¶
Index ¶
- Variables
- func SendTimeout(te *TimerEntity) bool
- func StopTimer(h TimerHandle) bool
- type Configuration
- type TimerAction
- type TimerActionCommon
- type TimerActionWrapper
- type TimerEntity
- type TimerHandle
- func AfterTimer(taw TimerActionWrapper, ud interface{}, interval time.Duration) (TimerHandle, bool)
- func StartTimer(ta TimerAction, ud interface{}, interval time.Duration, times int) (TimerHandle, bool)
- func StartTimerByObject(src *basic.Object, ta TimerAction, ud interface{}, interval time.Duration, ...) (TimerHandle, bool)
- type TimerMgr
- type TimerQueue
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TimerHandleGenerator uint32 = 1 InvalidTimerHandle TimerHandle = 0 TimerModule *TimerMgr = NewTimerMgr() )
View Source
var Config = Configuration{}
Functions ¶
func SendTimeout ¶
func SendTimeout(te *TimerEntity) bool
func StopTimer ¶
func StopTimer(h TimerHandle) bool
Types ¶
type Configuration ¶
func (*Configuration) Close ¶
func (c *Configuration) Close() error
func (*Configuration) Init ¶
func (c *Configuration) Init() error
func (*Configuration) Name ¶
func (c *Configuration) Name() string
type TimerAction ¶
type TimerAction interface {
OnTimer(h TimerHandle, ud interface{}) bool
}
type TimerActionCommon ¶
type TimerActionCommon struct {
Taw TimerActionWrapper
}
func (TimerActionCommon) OnTimer ¶
func (this TimerActionCommon) OnTimer(h TimerHandle, ud interface{}) bool
type TimerActionWrapper ¶
type TimerActionWrapper func(h TimerHandle, ud interface{}) bool
func (TimerActionWrapper) OnTimer ¶
func (taw TimerActionWrapper) OnTimer(h TimerHandle, ud interface{}) bool
type TimerEntity ¶
type TimerEntity struct {
// contains filtered or unexported fields
}
type TimerHandle ¶
type TimerHandle uint32
func AfterTimer ¶
func AfterTimer(taw TimerActionWrapper, ud interface{}, interval time.Duration) (TimerHandle, bool)
func StartTimer ¶
func StartTimer(ta TimerAction, ud interface{}, interval time.Duration, times int) (TimerHandle, bool)
StartTimer only can be called in main module
func StartTimerByObject ¶
func StartTimerByObject(src *basic.Object, ta TimerAction, ud interface{}, interval time.Duration, times int) (TimerHandle, bool)
type TimerQueue ¶
type TimerQueue struct {
// contains filtered or unexported fields
}
func NewTimerQueue ¶
func NewTimerQueue() *TimerQueue
func (TimerQueue) Len ¶
func (tq TimerQueue) Len() int
func (TimerQueue) Less ¶
func (tq TimerQueue) Less(i, j int) bool
func (*TimerQueue) Pop ¶
func (tq *TimerQueue) Pop() interface{}
func (*TimerQueue) Push ¶
func (tq *TimerQueue) Push(x interface{})
func (*TimerQueue) Swap ¶
func (tq *TimerQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.