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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user