[ 项目 ] 优化业务队列等待逻辑

This commit is contained in:
zeaslity
2023-07-06 15:49:14 +08:00
parent 129f388cfa
commit f5a3db2f56
5 changed files with 18 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ var OctopusToServerQueue = &RabbitQueue{}
var P = g.G.P
func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
func BuildOMsgRuntimeConnectorQueue(agentTopicName string) chan bool {
// 建立 业务消息 接收队列
// agentTopicName为名称的队列
@@ -51,7 +51,7 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
log.InfoF("Octopus Message Business Runtime Queue is established ! => %v", OctopusToServerQueue)
deliveries := octopusMsgQueue.Read(true)
forever := make(chan bool)
businessForeverChan := make(chan bool)
P.Submit(
func() {
// 死循环处理Octopus Message
@@ -72,7 +72,6 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
}
})
// wait forever
<-forever
return businessForeverChan
}