-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for native coroutines (asyncio) #435
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #435 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 1200 1231 +31
Branches 174 179 +5
=========================================
+ Hits 1200 1231 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am chatting with the author over twitter - just left some comments here.
Quality Gate passedIssues Measures |
This PR changes the internals of the library. All the inner code becomes async with a thin sync wrapper.
This allows support for native coroutines, as expected in #388, also allows awaiting any event handler. A developer can mix sync and async callbacks freely, like using a web framework like
FastAPI
.Milestones:
Examples
Async Air Conditioner machine
A StateMachine that exercises reading from a stream of events.
Note the new API
sm.async_send()
in contrast with the current syncsm.send()
.Testing
Async Order Control
Note the new API for async trigger an event
sm.async_<event_name>()
in contrast with the current syncsm.<event_name>()
.Testing