-
Notifications
You must be signed in to change notification settings - Fork 306
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
backends/bluezdbus: use an a new reactor for each client #143
Conversation
This makes things much cleaner : - The default asyncio event loop is not modified - No default twisted reactor is installed - The reactor will use the provided event loop
This. This is how it should have been from the start. Thank you very much, this I will merge immediately! |
Thanks. I haven't got much experience with asyncio and multiple event loops. I'm still wondering exactly how useful the "loop" argument is, since we're already in an async function, there must already be a running event loop, and I don't think you can await on tasks from another event loop |
If no loop is specified, the default loop will be used. There are multiple people you have asked about sending in non-default loops, This enables running multiple BleakClients in the same process, which is highly desireable. |
This tries to ensure that reactor is closed and deleted after client disconnects, to fix #130
This tries to ensure that reactor is closed and deleted after client disconnects, to fix #130
This tries to ensure that reactor is closed and deleted after client disconnects, to fix hbldh#130
actually this is problematic... It looks like the reactor leaks file descriptors (2-3 for each connected client). So if you are connecting and disconnecting devices continuously you will run out of file descriptors and crash. I am not really familiar with twisted, but as I understand it, there are wakers installed represented by file descriptors and neither closed by calling |
The only reference I found is this really old ticket: https://twistedmatrix.com/trac/ticket/3063 |
This tries to ensure that reactor is closed and deleted after client disconnects, to fix hbldh#130
This tries to ensure that reactor is closed and deleted after client disconnects, to fix #130
This makes things much cleaner :
Related to: #93 #125