summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/asyncio/core.py
Commit message (Collapse)AuthorAge
* extmod/asyncio: Fix early exit of asyncio scheduler.Yoctopuce dev2025-05-07
| | | | | | | | | | | | | | | | | | | | | This commit fixes three open issues related to the asyncio scheduler exiting prematurely when the main task queue is empty, in cases where CPython would not exit (for example, because the main task is not done because it's on a different queue). In the first case, the scheduler exits because running a task via `run_until_complete` did not schedule any dependent tasks. In the other two cases, the scheduler exits because the tasks are queued in an event queue. Tests have been added which reproduce the original issues. These test cases document the unauthorized use of `Event.set()` from a soft IRQ, and are skipped in unsupported environments (webassembly and native emitter). Fixes issues #16759, #16569 and #16318. Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
* extmod/asyncio: Make current_task raise exception when there is no task.Damien George2024-02-28
| | | | | | | | Matches CPython behaviour. Fixes issue #11530. Signed-off-by: Damien George <damien@micropython.org>
* extmod/asyncio: Support gather of tasks that finish early.Damien George2024-01-22
| | | | | | | Adds support to asyncio.gather() for the case that one or more (or all) sub-tasks finish and/or raise an exception before the gather starts. Signed-off-by: Damien George <damien@micropython.org>
* extmod/asyncio: Emit errors to stderr, not stdout.Matthias Urlichs2023-10-13
| | | | | | | | | | Sometimes these are different file descriptors, not to mention the Unix port, so use stderr to distinguish these error messages. CPython prints to stdout, but it does it via a call to the logging module. We don't want to introduce a dependency on logging, so printing to stderr is a good alternative. One can override default_exception_handler() if needed.
* extmod/asyncio: Rename uasyncio to asyncio.Jim Mussared2023-06-19
The asyncio module now has much better CPython compatibility and deserves to be just called "asyncio". This will avoid people having to write `from uasyncio import asyncio`. Renames all files, and updates port manifests to use the new path. Also renames the built-in _uasyncio to _asyncio. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>