From db137e70dcf67de26828e17c2d3dc9d21e971eb0 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 9 Apr 2020 13:15:47 +1000 Subject: extmod/uasyncio: Add Loop.new_event_loop method. This commit adds Loop.new_event_loop() which is used to reset the singleton event loop. This functionality is put here instead of in Loop.close() to make it possible to write code that is compatible with CPython. --- docs/library/uasyncio.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs') diff --git a/docs/library/uasyncio.rst b/docs/library/uasyncio.rst index 9cb0ca9bb..0f363a076 100644 --- a/docs/library/uasyncio.rst +++ b/docs/library/uasyncio.rst @@ -244,6 +244,13 @@ Event Loop Return the event loop used to schedule and run tasks. See `Loop`. +.. function:: new_event_loop() + + Reset the event loop and return it. + + Note: since MicroPython only has a single event loop this function just + resets the loop's state, it does not create a new one. + .. class:: Loop() This represents the object which schedules and runs tasks. It cannot be -- cgit v1.2.3