forked from hbldh/bleak
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hbldh#193 from hbldh/release/0.6.2
Version 0.6.2 Better cleanup of Bluez notifications (merges hbldh#154 and fixes hbldh#130 ) Fix for read_gatt_char in Core Bluetooth (fixes hbldh#177) Fix for is_disconnected in Core Bluetooth (merges hbldh#187 and fixes hbldh#185) Added disconnection_callback functionality for Core Bluetooth (merges hbldh#186 and fixes hbldh#184) Documentation fixes Added requirements.txt
- Loading branch information
Showing
13 changed files
with
142 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
__version__ = "0.6.1" | ||
__version__ = "0.6.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from asyncio import AbstractEventLoop | ||
|
||
from twisted.internet.asyncioreactor import AsyncioSelectorReactor | ||
|
||
_reactors = {} | ||
|
||
|
||
def get_reactor(loop: AbstractEventLoop): | ||
"""Helper factory to get a Twisted reactor for the provided loop. | ||
Since the AsyncioSelectorReactor on POSIX systems leaks file descriptors | ||
even if stopped and presumably cleaned up, we lazily initialize them and | ||
cache them for each loop. In a normal use case you will only work on one | ||
event loop anyway, but in the case someone has different loops, this | ||
construct still works without leaking resources. | ||
Args: | ||
loop (asyncio.events.AbstractEventLoop): The event loop to use. | ||
Returns: | ||
A :py:class:`twisted.internet.asnycioreactor.AsyncioSelectorReactor` | ||
running on the provided asyncio event loop. | ||
""" | ||
if loop not in _reactors: | ||
_reactors[loop] = AsyncioSelectorReactor(loop) | ||
|
||
return _reactors[loop] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.