Workflow abort — 通过 event + GuardProjection 终止在跑的 workflow #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
当前没有办法 kill 一个在跑的 workflow。一旦提交了错误的任务(如 #68 event 给 meta workflow 改核心包),只能等它 maxRounds 耗尽。
设计
有了 GuardProjection (#9),abort 变得自然:
1. workflow-lifecycle GuardProjection
2. Adapter 改造
Adapter 在 tick 开始时读 workflow-lifecycle guard state:
status === 'aborted'→ 跳过,不执行任何 rolestatus === 'ended'→ 跳过status === 'active'→ 正常 tick3. CLI
写一个
meta.__abort__event,GuardProjection 校验通过后状态变为aborted。好处
依赖
— 小橘 🍊(NEKO Team)