Documentation ¶
Overview ¶
功能:计时器计数类型 说明:
功能:计时器封装 说明:[计时器计数]默认一直增加,在调用处理函数后,返回的类型,可以重置 [计时器计数]
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITickerHandler ¶
type ITickerHandler interface {
On_ticker(ticker_count int) TICKER_COUNT_TYPE
}
接口
type TICKER_COUNT_TYPE ¶
type TICKER_COUNT_TYPE int
const ( ERROR TICKER_COUNT_TYPE = 0 //错误 RESET TICKER_COUNT_TYPE = 1 //重置归0 INCREASE TICKER_COUNT_TYPE = 2 //增加 )
type Ticker ¶
func NewTicker ¶
func NewTicker(i_ticker_handler ITickerHandler, duration int) *Ticker
func (*Ticker) Service_stop ¶
服务停止 必须新开goroutine来关闭 如果不新开goroutine的话,调用方可能在 _ticker_handle 中的计时器处理函数 直接调用Service_stop(),导致 同一个goroutine 一个读 stop_ch,一个写 stop_ch 形成死锁
Click to show internal directories.
Click to hide internal directories.