Versions in this module Expand all Collapse all v1 v1.0.2 Mar 1, 2021 v1.0.1 Feb 28, 2021 Changes in this version + func NewServer(config *Config) iface.IServer + type Config struct + DelayTime time.Duration + MaxDbTaskLen uint32 + MaxDeadTaskLen uint32 + MaxRetry int64 + MaxWorkerTaskLen uint32 + Name string + Version string + WorkerPoolSize uint32 + type Message struct + BizType string + Content string + MsgId uint32 + Param map[string]interface{} + func NewMessage(id uint32, bizType, Content string, param map[string]interface{}) *Message + func (m *Message) GetBizType() string + func (m *Message) GetContent() string + func (m *Message) GetMsgId() uint32 + func (m *Message) GetParam() map[string]interface{} + func (m *Message) SetBizType(bizType string) + func (m *Message) SetContent(content string) + func (m *Message) SetMsgId(msgId uint32) + func (m *Message) SetParam(param map[string]interface{}) + type MsgHandle struct + Apis map[string]iface.IRouter + DbQueue chan iface.IMessage + DeadQueue chan iface.IMessage + Delay time.Duration + Exit chan struct{} + Lock sync.RWMutex + MaxRetry int64 + Pc []atomic2.Int64 + RetryKV map[string]atomic2.Int64 + Setting *Config + Status bool + TaskQueue []chan iface.IMessage + WorkerPoolSize uint32 + func NewMsgHandle(config *Config) *MsgHandle + func (mh *MsgHandle) AddRouter(bizType string, router iface.IRouter) + func (mh *MsgHandle) DoDbHandler(request iface.IMessage) + func (mh *MsgHandle) DoDeadHandler(request iface.IMessage) + func (mh *MsgHandle) DoMsgHandler(request iface.IMessage, workerID int) + func (mh *MsgHandle) SendMsgToTaskQueue(request iface.IMessage) + func (mh *MsgHandle) StartDbWork() + func (mh *MsgHandle) StartDeadWork() + func (mh *MsgHandle) StartOneWorker(workerID int, taskQueue chan iface.IMessage) + func (mh *MsgHandle) StartWorkerPool() + func (mh *MsgHandle) Stat() []atomic2.Int64 + func (mh *MsgHandle) Stop() + type Server struct + Name string + func (s *Server) AddMessage(msg iface.IMessage) + func (s *Server) AddRouter(bizType string, router iface.IRouter) + func (s *Server) Serve() + func (s *Server) Start() + func (s *Server) Stat() []atomic2.Int64 + func (s *Server) Stop()