Skip to content

Commit

Permalink
Updated eventloop to use classmethod instead of staticmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Oct 4, 2023
1 parent a385840 commit 3647104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ably/executer/eventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def __init__(self, loop, thread=None):
self.__thread = thread
self.__is_active = True

@staticmethod
@classmethod
def get_global(cls) -> 'AppEventLoop':
if cls._global is None or not cls._global.__is_active:
cls._global = cls.create(False)
return cls._global

@staticmethod
@classmethod
def create(cls, background=True) -> 'AppEventLoop':
loop = asyncio.new_event_loop()
thread = threading.Thread(target=loop.run_forever, daemon=background)
Expand Down

0 comments on commit 3647104

Please sign in to comment.