You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
845 B

4 years ago
4 years ago
  1. // Package ziface 主要提供zinx全部抽象层接口定义.
  2. // 包括:
  3. // IServer 服务mod接口
  4. // IRouter 路由mod接口
  5. // IConnection 连接mod层接口
  6. // IMessage 消息mod接口
  7. // IDataPack 消息拆解接口
  8. // IMsgHandler 消息处理及协程池接口
  9. //
  10. // 当前文件描述:
  11. // @Title imsghandler.go
  12. // @Description 提供worker启动、处理消息业务调用等接口
  13. // @Author Aceld - Thu Mar 11 10:32:29 CST 2019
  14. package ziface
  15. /*
  16. 消息管理抽象层
  17. */
  18. type IMsgHandle interface {
  19. DoMsgHandler(request IRequest) //马上以非阻塞方式处理消息
  20. AddRouter(msgID uint32, router IRouter) //为消息添加具体的处理逻辑
  21. StartWorkerPool() //启动worker工作池
  22. SendMsgToTaskQueue(request IRequest) //将消息交给TaskQueue,由worker进行处理
  23. }