Event loops

Event loops

1. Event loop functions

The following functions are convenient shortcuts to accessing the methods of the global policy. Note that this provides access to the default policy, unless an alternative policy was set by calling set_event_loop_policy() earlier in the execution of the process.

asyncio.get_event_loop()

Equivalent to calling get_event_loop_policy().get_event_loop().

asyncio.set_event_loop(loop)

Equivalent to calling get_event_loop_policy().set_event_loop(loop).

asyncio.new_event_loop()
<