Personally, if you're trying to do something async you might be better off writing your own state machine system from scratch.
However, I guess if you think about it, there's actually an intermediate state where you were in one state, you got the signal, and now you're waiting until the code completes async and you can move to the next state.
If you had state 1 and state 2, this could be state 1_busy:
So in that case I think you can do it with the current system. The handler for state 1 returns 1_busy, and then it sends a signal to the FSM when it properly completes, which causes 1_busy to change to 2?
© Espruino, powered by microcosm.
Report a problem