JState
JState copied to clipboard
Unexpected async transition
Hello,
it looks like the "transition" method now calls "transitionAsync" internally (rather than the other way around) and I'm finding that legacy code that relies on thread locals is failing with newer versions.
I think calling the transition from transitionAsync would make the behaviour more predictable for the end-user. I can create a PR if this approach seems sensible.
This seems like a valid consideration, but one which will take some effort to unwind. It should be possible as a user to interact with a synchronous, single-threaded state machine and have the async model be opt-in. The issue is that an async machine requires all synchronous transitions to queue up behind any async ones which are in flight, however this need not apply to a strictly synchronous machine.