Documentation ¶
Index ¶
- type ProcessorImpl
- func (p *ProcessorImpl) MakeResponse(response any, code ...int32) []byte
- func (p *ProcessorImpl) OnServerMessage(svr rpc.Server, msg *rpcmsg.RPCMessage)
- func (p *ProcessorImpl) OnSessionMessage(sess rpc.Session, msg *rpcmsg.RPCMessage)
- func (p *ProcessorImpl) RegisterResponseMsg(msgID int32, response any)
- func (p *ProcessorImpl) RegisterServerMsgHandler(msgID string, f func(rpc.Server, *rpcmsg.RPCMessage))
- func (p *ProcessorImpl) RegisterSessionMsgHandler(msgID int32, param any, f any)
- type RouterInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProcessorImpl ¶
type ProcessorImpl struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor(serviceName string, codec inet.Codec) *ProcessorImpl
func (*ProcessorImpl) MakeResponse ¶
func (p *ProcessorImpl) MakeResponse(response any, code ...int32) []byte
func (*ProcessorImpl) OnServerMessage ¶
func (p *ProcessorImpl) OnServerMessage(svr rpc.Server, msg *rpcmsg.RPCMessage)
func (*ProcessorImpl) OnSessionMessage ¶
func (p *ProcessorImpl) OnSessionMessage(sess rpc.Session, msg *rpcmsg.RPCMessage)
网关转发的客户端消息 在协程中执行,若要使消息有序列,需要重新实现这个方法,将消息写入队列等方式
func (*ProcessorImpl) RegisterResponseMsg ¶
func (p *ProcessorImpl) RegisterResponseMsg(msgID int32, response any)
func (*ProcessorImpl) RegisterServerMsgHandler ¶
func (p *ProcessorImpl) RegisterServerMsgHandler(msgID string, f func(rpc.Server, *rpcmsg.RPCMessage))
func (*ProcessorImpl) RegisterSessionMsgHandler ¶
func (p *ProcessorImpl) RegisterSessionMsgHandler(msgID int32, param any, f any)
Click to show internal directories.
Click to hide internal directories.