From 08fc6792a26a9cfdfba49730a3c9b4b4a8fbd022 Mon Sep 17 00:00:00 2001 From: liuxiaobo Date: Fri, 6 Jun 2025 20:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/iservice.go | 6 +++--- timer/interface.go | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 timer/interface.go 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() +}