This PR modifies the state machine execution logic in a non-backwards compatible way, but does introduce clear semantics of what is done when and in which step of the TaskContext.
Open questions:
Shouldn't events be enabled already in entry{} ?
today they are not, and since we sleep after entry{} there's no way to intercept an event that came in during entry{} and respond to that. So the thing causing the event needs to move into run{}, but then a default transition will be taken if present because the event did not have time yet to be processed if it's send().
Should the user have the choice where the SM goes to sleep ?
This PR modifies the state machine execution logic in a non-backwards compatible way, but does introduce clear semantics of what is done when and in which step of the TaskContext.
Open questions: