-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy patheinx.go
62 lines (56 loc) · 1.49 KB
/
einx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package einx
import (
"github.com/Cyinx/einx/agent"
"github.com/Cyinx/einx/component"
"github.com/Cyinx/einx/context"
"github.com/Cyinx/einx/event"
"github.com/Cyinx/einx/lua"
"github.com/Cyinx/einx/module"
"github.com/Cyinx/einx/network"
"github.com/Cyinx/einx/timer"
"sync"
)
type Agent = agent.Agent
type AgentID = agent.AgentID
type Module = context.Module
type Context = context.Context
type EventMsg = event.EventMsg
type EventType = event.EventType
type ArgsVar = module.ArgsVar
type MsgHandler = module.MsgHandler
type RpcHandler = module.RpcHandler
type WorkerPool = module.WorkerPool
type Component = component.Component
type ComponentID = component.ComponentID
type ModuleRouter = module.ModuleRouter
type ComponentMgr = module.ComponentMgr
type SessionEventMsg = event.SessionEventMsg
type LuaRuntime = lua_state.LuaRuntime
type NetLinker = network.NetLinker
type ProtoTypeID = network.ProtoTypeID
type SessionMgr = network.SessionMgr
type SessionHandler = network.SessionHandler
type ITcpClientMgr = network.ITcpClientMgr
type ITcpServerMgr = network.ITcpServerMgr
type TimerHandler = timer.TimerHandler
type EventReceiver = event.EventReceiver
type ITranMsgMultiple = network.ITranMsgMultiple
type einx struct {
endWait sync.WaitGroup
closeChan chan bool
onClose func()
}
func (e *einx) doClose() {
onClose := e.onClose
if onClose != nil {
onClose()
<-e.closeChan
}
}
func (e *einx) close() {
module.Close()
e.endWait.Wait()
}
func (e *einx) continueClose() {
e.closeChan <- true
}