feat 模块增加after start

This commit is contained in:
2026-01-20 12:11:26 +08:00
parent 5aeff7c786
commit c0f6cd90c6
11 changed files with 43 additions and 38 deletions

View File

@@ -5,10 +5,12 @@ import (
"git.hlsq.asia/mmorpg/service-gateway/internal/global"
"git.hlsq.asia/mmorpg/service-gateway/internal/handler/ws_handler/login"
"runtime"
"sync"
)
// ModuleLoginQueue 登录队列模块
type ModuleLoginQueue struct {
module.DefaultModule
login *login.Login
queueUp *login.QueueUp
}
@@ -19,8 +21,9 @@ func (m *ModuleLoginQueue) Init() error {
return nil
}
func (m *ModuleLoginQueue) Start() error {
func (m *ModuleLoginQueue) Start(ready *sync.WaitGroup) error {
m.login.Start(runtime.NumCPU())
ready.Done()
return nil
}
@@ -28,7 +31,3 @@ func (m *ModuleLoginQueue) Stop() error {
m.login.Stop()
return nil
}
func (m *ModuleLoginQueue) Bind(_ ...any) module.Module {
return m
}