Receive 处理消息
(ctx *actor.Context, msg actor.Message)
| 267 | |
| 268 | // Receive 处理消息 |
| 269 | func (c *CoordinatorActor) Receive(ctx *actor.Context, msg actor.Message) { |
| 270 | switch m := msg.(type) { |
| 271 | case *actor.Started: |
| 272 | wfLog.Info(context.Background(), "coordinator started", nil) |
| 273 | |
| 274 | case *ExecuteWorkflowMsg: |
| 275 | c.handleExecuteWorkflow(ctx, m) |
| 276 | |
| 277 | case *NodeCompletedMsg: |
| 278 | c.handleNodeCompleted(ctx, m) |
| 279 | |
| 280 | case *NodeFailedMsg: |
| 281 | c.handleNodeFailed(ctx, m) |
| 282 | |
| 283 | case *CancelWorkflowMsg: |
| 284 | c.handleCancelWorkflow(ctx, m) |
| 285 | |
| 286 | case *actor.Terminated: |
| 287 | c.handleTerminated(ctx, m) |
| 288 | |
| 289 | case *actor.Stopping: |
| 290 | c.handleStopping(ctx) |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | // handleExecuteWorkflow 处理工作流执行请求 |
| 295 | func (c *CoordinatorActor) handleExecuteWorkflow(ctx *actor.Context, msg *ExecuteWorkflowMsg) { |
nothing calls this directly
no test coverage detected