circuitpython/extmod
Damien George 63b9944382 extmod/uasyncio: Add new implementation of uasyncio module.
This commit adds a completely new implementation of the uasyncio module.
The aim of this version (compared to the original one in micropython-lib)
is to be more compatible with CPython's asyncio module, so that one can
more easily write code that runs under both MicroPython and CPython (and
reuse CPython asyncio libraries, follow CPython asyncio tutorials, etc).
Async code is not easy to write and any knowledge users already have from
CPython asyncio should transfer to uasyncio without effort, and vice versa.

The implementation here attempts to provide good compatibility with
CPython's asyncio while still being "micro" enough to run where MicroPython
runs. This follows the general philosophy of MicroPython itself, to make it
feel like Python.

The main change is to use a Task object for each coroutine.  This allows
more flexibility to queue tasks in various places, eg the main run loop,
tasks waiting on events, locks or other tasks.  It no longer requires
pre-allocating a fixed queue size for the main run loop.

A pairing heap is used to queue Tasks.

It's currently implemented in pure Python, separated into components with
lazy importing for optional components.  In the future parts of this
implementation can be moved to C to improve speed and reduce memory usage.
But the aim is to maintain a pure-Python version as a reference version.
2020-03-26 01:25:45 +11:00
..
axtls-include py/py.mk: Build axtls library directly from its source files. 2018-09-08 00:07:23 +10:00
btstack extmod/modbluetooth: Change scan result's "connectable" to "adv_type". 2020-03-11 14:00:44 +11:00
crypto-algorithms extmod/crypto-algorithms: Add source to header and populate copyright. 2019-08-22 17:20:16 +10:00
lwip-include all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
nimble extmod/nimble: When getting BLE MAC try public address if random fails. 2020-03-11 14:02:13 +11:00
re1.5 extmod/re1.5: Support escaping within RE classes. 2019-10-18 12:20:32 +11:00
uasyncio extmod/uasyncio: Add new implementation of uasyncio module. 2020-03-26 01:25:45 +11:00
uzlib extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned. 2019-12-23 00:07:03 +11:00
webrepl all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
extmod.mk extmod: Consolidate FAT FS config to MICROPY_VFS_FAT across all ports. 2019-11-11 11:37:38 +11:00
machine_i2c.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_i2c.h extmod/machine_i2c: Change C-level API to allow split I2C transactions. 2019-05-20 15:04:29 +10:00
machine_mem.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_mem.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
machine_pinbase.c extmod/machine_pinbase: Put PinBase singleton in ROM. 2017-09-12 16:00:21 +10:00
machine_pinbase.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pulse.c esp8266: Provide custom machine_time_pulse_us that feeds soft WDT. 2019-07-01 22:53:00 +10:00
machine_pulse.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_signal.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_signal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_spi.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
machine_spi.h drivers/bus: Pull out software SPI implementation to dedicated driver. 2018-03-10 00:59:43 +11:00
misc.h extmod/uos_dupterm: Add mp_uos_dupterm_poll to poll all dupterms. 2019-07-01 17:10:12 +10:00
modbluetooth_hci.h stm32: Refactor Bluetooth HCI RX to be independent of transport layer. 2020-03-10 01:53:42 +11:00
modbluetooth.c extmod/modbluetooth: Change scan result's "connectable" to "adv_type". 2020-03-11 14:00:44 +11:00
modbluetooth.h extmod/modbluetooth: Change scan result's "connectable" to "adv_type". 2020-03-11 14:00:44 +11:00
modbtree.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modframebuf.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modlwip.c extmod/modlwip: Properly handle non-blocking and timeout on UDP recv. 2020-03-18 10:51:32 +11:00
modonewire.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modubinascii.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modubinascii.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
moducryptolib.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moductypes.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduhashlib.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduheapq.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modujson.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modurandom.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modure.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduselect.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modussl_axtls.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modussl_mbedtls.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modutimeq.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduwebsocket.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
moduwebsocket.h extmod/moduwebsocket: Refactor websocket to uwebsocket. 2019-02-14 00:35:45 +11:00
moduzlib.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
modwebrepl.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
network_cyw43.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
network_cyw43.h extmod: Add network-level class binding to cyw43 driver. 2019-06-03 16:47:35 +10:00
uos_dupterm.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
utime_mphal.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
utime_mphal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs_blockdev.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat_diskio.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat_file.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_fat.h extmod: Factor out block-device struct to make independent of fatfs. 2019-10-29 12:12:37 +11:00
vfs_lfs.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_lfs.h extmod: Add VFS littlefs bindings. 2019-10-29 14:17:29 +11:00
vfs_lfsx_file.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_lfsx.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_posix_file.c extmod/vfs_posix_file: Include unistd.h to get STD{IN,OUT,ERR}_FILENO. 2020-03-25 00:59:39 +11:00
vfs_posix.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs_posix.h extmod/vfs: Introduce a C-level VFS protocol, with fast import_stat. 2018-06-06 14:33:42 +10:00
vfs_reader.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
vfs.c extmod/vfs: Factor out vfs mount-and-chdir helper from stm32. 2020-03-11 14:24:26 +11:00
vfs.h extmod/vfs: Factor out vfs mount-and-chdir helper from stm32. 2020-03-11 14:24:26 +11:00
virtpin.c all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
virtpin.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00