Actyx / Actyx/machines

block state updates while command is in flight

Đang mở
#97 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
8
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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).

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.