[agent-go] 新增线程池部分代码

This commit is contained in:
zeaslity
2023-03-28 13:47:04 +08:00
parent 31f9267401
commit 84fe111482
6 changed files with 54 additions and 5 deletions

View File

@@ -8,6 +8,8 @@ import (
"fmt"
)
var P = g.G.P
func HandleOMsg(initOMsgFromServer *config.OctopusMessage) {
agentTopicName := initOMsgFromServer.Result.(string)
@@ -65,11 +67,17 @@ func doHandleOctopusMessage(octopusMessage *config.OctopusMessage) {
case g.InitOmType:
go func() {}()
case g.ExecOmType:
go executorOMHandler(octopusMessage)
P.Submit(func() {
executorOMHandler(octopusMessage)
})
case g.StatusOmType:
go statusOMHandler(octopusMessage)
P.Submit(func() {
statusOMHandler(octopusMessage)
})
default:
go blackHoleOMHandler(octopusMessage)
P.Submit(func() {
blackHoleOMHandler(octopusMessage)
})
}
}