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

Method handleCancelWorkflow

pkg/workflow/actor_engine.go:548–567  ·  view source on GitHub ↗

handleCancelWorkflow 处理取消工作流

(ctx *actor.Context, msg *CancelWorkflowMsg)

Source from the content-addressed store, hash-verified

546
547// handleCancelWorkflow 处理取消工作流
548func (c *CoordinatorActor) handleCancelWorkflow(ctx *actor.Context, msg *CancelWorkflowMsg) {
549 c.mu.Lock()
550 state, ok := c.runningWorkflows[msg.ExecutionID]
551 if ok {
552 delete(c.runningWorkflows, msg.ExecutionID)
553 }
554 c.mu.Unlock()
555
556 if ok {
557 // 停止所有相关 Agent
558 for _, pid := range state.agents {
559 c.engine.actorSystem.Stop(pid)
560 }
561
562 // 取消执行上下文
563 if state.execution.cancelFunc != nil {
564 state.execution.cancelFunc()
565 }
566 }
567}
568
569// handleTerminated 处理 Actor 终止通知
570func (c *CoordinatorActor) handleTerminated(ctx *actor.Context, msg *actor.Terminated) {

Callers 1

ReceiveMethod · 0.95

Calls 2

deleteFunction · 0.85
StopMethod · 0.65

Tested by

no test coverage detected