Skip to content

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

@zags4life

Description

@zags4life

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions