micropython/tests/ports
Damien George 8a3546b3bd webassembly: Add JavaScript-based asyncio support.
This commit adds a significant portion of the existing MicroPython asyncio
module to the webassembly port, using parts of the existing asyncio code
and some custom JavaScript parts.

The key difference to the standard asyncio is that this version uses the
JavaScript runtime to do the actual scheduling and waiting on events, eg
Promise fulfillment, timeouts, fetching URLs.

This implementation does not include asyncio.run(). Instead one just uses
asyncio.create_task(..) to start tasks and then returns to the JavaScript.
Then JavaScript will run the tasks.

The implementation here tries to reuse as much existing asyncio code as
possible, and gets all the semantics correct for things like cancellation
and asyncio.wait_for.  An alternative approach would reimplement Task,
Event, etc using JavaScript Promise's.  That approach is very difficult to
get right when trying to implement cancellation (because it's not possible
to cancel a JavaScript Promise).

Signed-off-by: Damien George <damien@micropython.org>
2024-04-24 16:24:00 +10:00
..
cc3200 all: Prune trailing whitespace. 2024-03-07 16:25:17 +11:00
esp32 tests: Move port-specific test directories into tests/ports/ directory. 2024-01-22 11:48:27 +11:00
qemu-arm tests: Move port-specific test directories into tests/ports/ directory. 2024-01-22 11:48:27 +11:00
renesas-ra tests: Move port-specific test directories into tests/ports/ directory. 2024-01-22 11:48:27 +11:00
rp2 tests/ports/rp2/rp2_dma.py: Tweak test to be more reliable. 2024-01-30 12:50:19 +11:00
stm32 tests: Move port-specific test directories into tests/ports/ directory. 2024-01-22 11:48:27 +11:00
stm32_hardware stm32/dma: Add D-cache protection for DMA RX operations, including SPI. 2024-03-08 12:19:48 +11:00
unix tests/ports/unix: Add coverage test for frozen functions and generators. 2024-02-16 14:17:01 +11:00
webassembly webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00