This commit is contained in:
liuxiaobo 2025-06-06 20:03:46 +08:00
parent d3f9dbb577
commit 08fc6792a2
2 changed files with 14 additions and 3 deletions

View File

@ -11,9 +11,9 @@ type IService interface {
RunOnce(cb func())
RunWait(cb func() (retValue any)) (retValue any, err error)
NewTimer(duration time.Duration, cb func(), needLog bool, desc ...string) uint32
CancelTimer(timerId uint32)
CancelAllTimer()
// NewTimer(duration time.Duration, cb func(), needLog bool, desc ...string) uint32
// CancelTimer(timerId uint32)
// CancelAllTimer()
// 向服务内部消息管道写入消息
Write(msg []byte) error

11
timer/interface.go Normal file
View File

@ -0,0 +1,11 @@
package timer
import (
"time"
)
type ITimer interface {
NewTimer(duration time.Duration, cb func(), needLog bool, desc ...string) uint32
CancelTimer(timerId uint32)
CancelAllTimer()
}