This release introduces native coroutine support using asyncio, enabling seamless integration with asynchronous code.
Now you can send and await for events, and also write async Actions, Conditions and Validators.
py
>>> class AsyncStateMachine(StateMachine):
... initial = State('Initial', initial=True)
... final = State('Final', final=True)
...
... advance = initial.to(final)
>>> async def run_sm():
... sm = AsyncStateMachine()
... await sm.advance()
... print(sm.current_state)
>>> asyncio.run(run_sm())
Final