You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b1fc2e2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/processing_model.md
+38-4Lines changed: 38 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,17 +76,51 @@ After the macrostep completes, the engine picks the next event from the
76
76
77
77
### Event queues
78
78
79
-
The engine maintains two separate FIFO queues:
79
+
The engine maintains two separate queues, each ordered by due time. Events due at the same
80
+
moment run in the order they were sent.
80
81
81
82
| Queue | How to enqueue | When processed |
82
83
|---|---|---|
83
-
|**Internal**| {func}`raise_() <StateMachine.raise_>`or `send(..., internal=True)`| Within the current macrostep |
84
-
|**External**| {func}`send() <StateMachine.send>`| After the current macrostep ends |
84
+
|**Internal**| {func}`raise_() <StateMachine.raise_>`, `send(..., internal=True)`, or an event declared with `Event(..., internal=True)`, from a callback| Within the current macrostep |
85
+
|**External**| {func}`send() <StateMachine.send>`, and any event triggered from outside a callback| After the current macrostep ends |
85
86
86
87
This distinction matters when you trigger events from inside callbacks.
87
88
Using `raise_()` ensures the event is handled as part of the current
88
89
processing cycle, while `send()` defers it to after the machine reaches
89
-
a stable configuration.
90
+
a stable configuration. An event declared `internal=True` behaves like
0 commit comments