Skip to content
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

Asynchronous _loop_ref should using the existing event loop if one exists #5102

Open
zags4life opened this issue Apr 4, 2024 · 0 comments · May be fixed by #5103
Open

Asynchronous _loop_ref should using the existing event loop if one exists #5102

zags4life opened this issue Apr 4, 2024 · 0 comments · May be fixed by #5103

Comments

@zags4life
Copy link

Asynchronous.event_loop should get the existing event loop, if one exists. I one does not exist, it should create a new event loop then set the event loop by calling asyncio.set_event_loop so downstream consumers can get access to the same event loop when they call asyncio.get_event_loop.

@property
def event_loop(self):
    if self._loop_ref is None:
        self._loop_ref = asyncio.new_event_loop()  <!-- never sets event loop
    return self._loop_ref
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant