You are viewing an older version (9.5.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.5.0 / IPython / core / async_helpers / get_asyncio_loop

function

IPython.core.async_helpers:get_asyncio_loop

source: /IPython/core/async_helpers.py :21

Signature

def   get_asyncio_loop ( )

Summary

asyncio has deprecated get_event_loop

Extended Summary

Replicate it here, with our desired semantics:

  • always returns a valid, not-closed loop

  • not thread-local like asyncio's, because we only want one loop for IPython

  • if called from inside a coroutine (e.g. in ipykernel), return the running loop

Aliases

  • IPython.core.async_helpers.get_asyncio_loop