-
Notifications
You must be signed in to change notification settings - Fork 117
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
Port accessories to asyncio #76
base: asyncio_run
Are you sure you want to change the base?
Conversation
Not a complete port, unfortunately some of the dependent libraries don’t support asyncio at the moment. However as Accessories are still running in separate threads at the moment we can ignore that. Additionally subprocess can’t use asyncio until the main thread is converted.
Hey! I will go over the PR later when I get to a computer. As for the loop in the driver - this is the core of the PR I opened, would you mind if I finish it? |
Ahh, I thought the PR you opened was only for the |
This makes sure that each accessory thread get a complete event loop to run the accessory with. Also ensure that the event loop is shutdown cleanly.
Hey! Too busy the last week, but I submitted the asyncio today (in dev). Could you revise this? |
Sure thing. Might take me few days tho, I have also had a very busy week.
Best
Thomas
…On 13 Apr 2018, 07:11 +0100, Ivan Kalchev ***@***.***>, wrote:
Hey! Too busy the last week, but I submitted the asyncio today (in dev). Could you revise this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
base36 | ||
aiohttp==3.1.1 |
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 don't like that we add a dependency that is only used for an optional accessory. If that's the way to go, we should move all optional accessories elsewhere #43.
Note that one of the merges broke the accessories (the Category is now in costs.py and is not a class). Will try to fix this soon |
This should merge into #74. Gonna start working on moving the HTTP bridge.
Unfortunately there are some limits to running the event loop in threads. Notably subprocess don't work in threads, unless the main thread is running an event loop.
I think I might start work migrating the driver over to asyncio, so an event loop is running in the main thread.
With regards to this port, feedback welcome, also testing as I don't have access to all the hardware.