diff --git a/service/iservice.go b/service/iservice.go index 6068e95..69de4a7 100644 --- a/service/iservice.go +++ b/service/iservice.go @@ -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 diff --git a/timer/interface.go b/timer/interface.go new file mode 100644 index 0000000..e279df5 --- /dev/null +++ b/timer/interface.go @@ -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() +}