micropython/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
..
bare-arm shared/libc/string0: Don't deref args for n==0 case. 2023-11-07 16:01:50 +11:00
cc3200 extmod/modmachine: Add MICROPY_PY_MACHINE_RESET configuration option. 2024-03-15 12:04:37 +11:00
embed all: Prune trailing whitespace. 2024-03-07 16:25:17 +11:00
esp32 esp32/network_wlan: Add interface and security WLAN constants. 2024-03-28 13:01:55 +11:00
esp8266 esp8266/network_wlan: Add interface and security WLAN constants. 2024-03-28 13:01:55 +11:00
mimxrt mimxrt: Add support for OpenAMP. 2024-03-29 17:59:29 +11:00
minimal minimal: Use printf instead of echo -e. 2024-02-15 16:36:22 +11:00
nrf nrf/Makefile: Clean up dangling LIBS declaration. 2024-03-26 16:54:21 +11:00
pic16bit all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
powerpc py/mpconfig: Disable qstr hashing at minimum feature level. 2024-01-25 16:38:17 +11:00
qemu-arm all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
renesas-ra renesas-ra/boards/ARDUINO_PORTENTA_C33: Add Arduino's external library. 2024-03-26 17:03:56 +11:00
rp2 rp2/README: Fix typo, improve sentence about building with other boards. 2024-04-22 10:20:54 +10:00
samd samd/mcu: Guard static function with appropriate #if. 2024-03-29 17:48:06 +11:00
stm32 stm32/mpremoteprocport: Use metal logging functions. 2024-03-29 17:59:18 +11:00
unix unix/variants: Don't use native _Float16 type. 2024-03-20 14:13:49 +11:00
webassembly webassembly: Add JavaScript-based asyncio support. 2024-04-24 16:24:00 +10:00
windows py/objdeque: Expand implementation to be doubly-ended and support iter. 2024-03-18 14:10:14 +11:00
zephyr all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00