Files
service-qgdzs/app/timer.go

30 lines
484 B
Go

package app
import (
"git.hlsq.asia/mmorpg/service-common/module"
"git.hlsq.asia/mmorpg/service-qgdzs/internal/timer"
"sync"
)
// ModuleTimer 定时器模块
type ModuleTimer struct {
module.DefaultModule
timer *timer.Timer
}
func (m *ModuleTimer) Init() error {
m.timer = &timer.Timer{}
return nil
}
func (m *ModuleTimer) Start(ready *sync.WaitGroup) error {
m.timer.Start()
ready.Done()
return nil
}
func (m *ModuleTimer) Stop() error {
m.timer.Stop()
return nil
}