新增服务间事件通知机制

This commit is contained in:
duanhf2012
2020-04-20 15:38:42 +08:00
parent 990fec396a
commit 742ffc410e
10 changed files with 311 additions and 123 deletions

View File

@@ -3,7 +3,13 @@ package network
type Processor interface {
// must goroutine safe
Route(msg interface{}, userData interface{}) error
MsgRoute(msg interface{}, userData interface{}) error
//must goroutine safe
UnknownMsgRoute(msg interface{}, userData interface{})
// connect event
ConnectedRoute(userData interface{})
DisConnectedRoute(userData interface{})
// must goroutine safe
Unmarshal(data []byte) (interface{}, error)
// must goroutine safe