Documentation ¶
Index ¶
- type MessageList
- func (m *MessageList) BeginProcessLoop()
- func (m *MessageList) BeginWork()
- func (m *MessageList) GetModuleName() string
- func (m *MessageList) Init()
- func (m *MessageList) IsExit() bool
- func (m *MessageList) OnForeseeMessage(msg message.BaseMessage) (done bool)
- func (m *MessageList) OnForeseeResponse(rsp message.BaseResponse) (done bool)
- func (m *MessageList) OnProcessMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
- func (m *MessageList) OnProcessResponse(rsp message.BaseResponse)
- func (m *MessageList) PushMessage(msg message.BaseMessage)
- func (m *MessageList) PushResponse(rsp message.BaseResponse)
- func (m *MessageList) SendMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
- func (m *MessageList) StopProcessLoop()
- func (m *MessageList) StopWork()
- func (m *MessageList) Uninit()
- type MessageQueue
- type MessageRoute
- func (o *MessageRoute) AddProcess(process ProcessInterface) (result bool)
- func (o *MessageRoute) Beginwork()
- func (o *MessageRoute) SendMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
- func (o *MessageRoute) SendResponse(rsp message.BaseResponse)
- func (o *MessageRoute) StopWork()
- type ProcessInterface
- type ResponseQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageList ¶
type MessageList struct { MessageRoute *MessageRoute // 消息路由模块 Process ProcessInterface // 当前模块 ModuleName string // 模块名称 // contains filtered or unexported fields }
消息队列
func (*MessageList) OnForeseeMessage ¶
func (m *MessageList) OnForeseeMessage(msg message.BaseMessage) (done bool)
偷窥消息
func (*MessageList) OnForeseeResponse ¶
func (m *MessageList) OnForeseeResponse(rsp message.BaseResponse) (done bool)
偷窥消息的回应
func (*MessageList) OnProcessMessage ¶
func (m *MessageList) OnProcessMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
处理消息
func (*MessageList) OnProcessResponse ¶
func (m *MessageList) OnProcessResponse(rsp message.BaseResponse)
处理消息的回应
func (*MessageList) PushMessage ¶
func (m *MessageList) PushMessage(msg message.BaseMessage)
把消息放入消息队列
func (*MessageList) PushResponse ¶
func (m *MessageList) PushResponse(rsp message.BaseResponse)
把消息的回应放入回应队列
func (*MessageList) SendMessage ¶
func (m *MessageList) SendMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
发送消息
type MessageQueue ¶
type MessageQueue []message.BaseMessage
type MessageRoute ¶
type MessageRoute struct {
// contains filtered or unexported fields
}
处理消息的模块
func (*MessageRoute) AddProcess ¶
func (o *MessageRoute) AddProcess(process ProcessInterface) (result bool)
添加观察者
func (*MessageRoute) SendMessage ¶
func (o *MessageRoute) SendMessage(msg message.BaseMessage) (rsp message.BaseResponse, err error)
发送消息
func (*MessageRoute) SendResponse ¶
func (o *MessageRoute) SendResponse(rsp message.BaseResponse)
发送消息的回应
type ProcessInterface ¶
type ProcessInterface interface { // 初始化 Init() // 反初始化 Uninit() // 开始工作 BeginWork() // 停止工作 StopWork() // 开启消息队列 BeginProcessLoop() // 退出消息队列 StopProcessLoop() // 获取模块名称 GetModuleName() string // 把消息放入消息队列 PushMessage(message message.BaseMessage) // 把消息的回应放入回应队列 PushResponse(response message.BaseResponse) // 偷窥消息 OnForeseeMessage(message message.BaseMessage) (done bool) // 处理消息 OnProcessMessage(message message.BaseMessage) (response message.BaseResponse, err error) // 偷窥消息的回应 OnForeseeResponse(response message.BaseResponse) (done bool) // 处理消息的回应 OnProcessResponse(response message.BaseResponse) // 发送消息 SendMessage(message message.BaseMessage) (response message.BaseResponse, err error) }
处理消息的接口
type ResponseQueue ¶
type ResponseQueue []message.BaseResponse
Click to show internal directories.
Click to hide internal directories.