[Excution] - base function start - 3

This commit is contained in:
IceDerce
2023-06-25 11:26:33 +08:00
parent 6ce6e5f0d3
commit fb38ab8f15
7 changed files with 136 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
package rabbitmq
import (
"agent-go"
"agent-go/g"
"encoding/json"
"fmt"
@@ -50,12 +51,12 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
deliveries := octopusMsgQueue.Read(true)
forever := make(chan bool)
P.Submit(
main.P.Submit(
func() {
// 死循环处理Octopus Message
for delivery := range deliveries {
var om *OctopusMessage
var om *main.OctopusMessage
err := json.Unmarshal(delivery.Body, &om)
if err != nil {
log.Error(fmt.Sprintf("octopus message convert to json is wrong! msg is => %s", delivery.Body))
@@ -64,7 +65,7 @@ func BuildOMsgRuntimeConnectorQueue(agentTopicName string) {
}
// 策略模式 处理消息
P.Submit(func() {
main.P.Submit(func() {
om.Handle()
})
}