diff --git a/ably/executer/eventloop.py b/ably/executer/eventloop.py index 4be7b440..935a4a93 100644 --- a/ably/executer/eventloop.py +++ b/ably/executer/eventloop.py @@ -20,13 +20,13 @@ def __init__(self, loop, thread=None): @staticmethod def get_global() -> 'AppEventLoop': if AppEventLoop._global is None or not AppEventLoop._global.__is_active: - AppEventLoop._global = AppEventLoop.create(True) + AppEventLoop._global = AppEventLoop.create() return AppEventLoop._global @staticmethod - def create(background=False) -> 'AppEventLoop': + def create() -> 'AppEventLoop': loop = asyncio.new_event_loop() - thread = threading.Thread(target=loop.run_forever, daemon=background) + thread = threading.Thread(target=loop.run_forever, daemon=True) thread.start() return AppEventLoop(loop, thread) diff --git a/ably/rest/rest.py b/ably/rest/rest.py index 1e126091..f59a5c1a 100644 --- a/ably/rest/rest.py +++ b/ably/rest/rest.py @@ -67,7 +67,7 @@ def __init__(self, key: Optional[str] = None, token: Optional[str] = None, self.__sync_enabled = options.sync_enabled if self.__sync_enabled: if options.loop is None: - self.__app_loop = AppEventLoop.create(True) + self.__app_loop = AppEventLoop.create() else: self.__app_loop = AppEventLoop(loop=options.loop)