-
Notifications
You must be signed in to change notification settings - Fork 645
Add asyncio support #388
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
Add asyncio support #388
Conversation
Uhh, looks really nice! |
Codecov Report
@@ Coverage Diff @@
## develop #388 +/- ##
===========================================
+ Coverage 59.25% 59.26% +<.01%
===========================================
Files 55 55
Lines 4261 4328 +67
===========================================
+ Hits 2525 2565 +40
- Misses 1736 1763 +27 |
Could you add a test for this on |
The problem is that testing this will require statements that are not available in Python 2.7 so it won’t even be able to read the file. Not sure if that can be handled by pytest. |
Hm, I see. |
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.
Very cool!
I tried it out on python 3.6 and saw messages on a vcan bus, and verified that the new test correctly gets skipped on python 2.7.
Thanks for your patience with this addition
Adds support for developing asyncio applications with python-can more easily. This can be useful when implementing protocols that handles simultaneous connections to many nodes since you can write synchronous looking code without handling multiple threads and locking mechanisms.
For information I started working a year ago or so on adding native asyncio support for each interface but abandoned it since not all API's support callbacks and the performance would probably be worse than using a thread for reading messages.