More granular action sequencing #512
Replies: 1 comment 1 reply
-
Hi @emptierset , how are you? Eventually, one day, all actions in the same "group" could run in parallel. Currently, they run in sequence in the sync engine and concurrently on the asynchronous engine (using Assuming that you are using the sync engine (no async callbacks), there's a second level of priority that you can use, but it's still an implementation detail that can change in the future: It's the Callback priority order by how they are registered. All the priorities are in the example: https://python-statemachine.readthedocs.io/en/latest/auto_examples/all_actions_machine.html#testing The priorities: python-statemachine/statemachine/callbacks.py Lines 26 to 31 in 4449a9c This means that the callbacks of the same group are ordered when inserted on the list, and for the sync engine they are executed sequentially, so callbacks of generic name convention like The short answer is that there's not yet a Public contract in an order, but if you can rely on an implementation detail, they are ordered. Best! |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help with my last question.
I've reproduced the order of actions from RTD for our convenience:
Is there a way to sequence the
on
actions or to insert actions betweenon
andenter
? I have some actions that produce logging that I want to run last among theon
actions. My original idea was to run themafter
, but that is after the state change, and many things could have happened onenter
that I wouldn't want to happen beforehand.Beta Was this translation helpful? Give feedback.
All reactions