MCPcopy Create free account
hub / github.com/astercloud/aster / handleExecuteWorkflow

Method handleExecuteWorkflow

pkg/workflow/actor_engine.go:295–312  ·  view source on GitHub ↗

handleExecuteWorkflow 处理工作流执行请求

(ctx *actor.Context, msg *ExecuteWorkflowMsg)

Source from the content-addressed store, hash-verified

293
294// handleExecuteWorkflow 处理工作流执行请求
295func (c *CoordinatorActor) handleExecuteWorkflow(ctx *actor.Context, msg *ExecuteWorkflowMsg) {
296 execution := msg.Execution
297
298 // 创建工作流状态
299 state := &workflowState{
300 execution: execution,
301 resultCh: msg.ResultCh,
302 errorCh: msg.ErrorCh,
303 agents: make(map[string]*actor.PID),
304 }
305
306 c.mu.Lock()
307 c.runningWorkflows[execution.ID] = state
308 c.mu.Unlock()
309
310 // 开始执行
311 go c.executeWorkflowAsync(execution, state)
312}
313
314// executeWorkflowAsync 异步执行工作流
315func (c *CoordinatorActor) executeWorkflowAsync(execution *WorkflowExecution, state *workflowState) {

Callers 1

ReceiveMethod · 0.95

Calls 1

executeWorkflowAsyncMethod · 0.95

Tested by

no test coverage detected