Transitions that take long time #1545
Replies: 1 comment
-
There is no such thing as a "transition that takes a long time". Transitions are always assumed to be instantaneous: when you're in state A and an event is received, you are immediately transitioned to state B. You should be modeling this "pending" state as another state. With You can abstract this in userland, but you need to define that "pending" state as an explicit state. This is how state machines and statecharts work as a mathematical model; it's not something we can change just for developer convenience. Can you share an example of code where this has been a problem? |
Beta Was this translation helpful? Give feedback.
-
We need a way to specify that a transition is in progress and prevent other state changes in background, while a transition is currently in progress.
Examples where transitions may not be automatic: database or network operation takes a long time, payment operation that need a person enter a OTP (One Time Password received on Mobile devices)
I understand that one can introduce a number of new/transient states to handle this, but this is one area I have seen developers miss out the transition states and the overall system becomes unstable.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions