Actyx / Actyx/machines

block state updates while command is in flight

未关闭
#97 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
8
派生
2
PR 合并指标
30 天内没有已合并 PR

描述

Currently the user needs to defend against getting an unrelated state update originating from a network event immediately after invoking a command:
```typescript
let thingDone = false
for await (const state of machine) {
if (state.is(SomeState) && !thingDonw) {
state.cast().commands()?.doTheThing()
thingDone = true
}
}
```
It would be nicer and more intuitive if the next loop iteration was guaranteed to contain the information that was published via the `doTheThing` action (which usually will be reflected in transitioning to a new state, but might also just add something to the current state).

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by tracing the async iteration shown in the issue, especially the `for await (const state of machine)` loop and the `doTheThing` command. Determine where command publication and subsequent state delivery are coordinated. Done means the next loop iteration reliably includes the command's published information without requiring the caller's `thingDone` guard.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。