New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extmod: add new implementation of uasyncio #5332
Commits on Mar 25, 2020
-
py/mpconfig.h: Enable MICROPY_MODULE_GETATTR by default.
To enable lazy loading of submodules (among other things), which is very useful for MicroPython libraries that want to have optional subcomponents. Disabled explicitly on minimal ports.
Configuration menu - View commit details
-
Copy full SHA for f8fc786 - Browse repository at this point
Copy the full SHA f8fc786View commit details -
qemu-arm: Set default board as mps2-an385 to get more flash for tests.
And use Ubuntu bionic for qemu-arm Travic CI job.
Configuration menu - View commit details
-
Copy full SHA for ab00f4c - Browse repository at this point
Copy the full SHA ab00f4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 98ab764 - Browse repository at this point
Copy the full SHA 98ab764View commit details -
py/pairheap: Properly unlink node on pop and delete.
This fixes a bug in the pairing-heap implementation when nodes are deleted with mp_pairheap_delete and then reinserted later on.
Configuration menu - View commit details
-
Copy full SHA for c47a3dd - Browse repository at this point
Copy the full SHA c47a3ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c7e78d - Browse repository at this point
Copy the full SHA 6c7e78dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f9741d1 - Browse repository at this point
Copy the full SHA f9741d1View commit details -
Configuration menu - View commit details
-
Copy full SHA for f05ae41 - Browse repository at this point
Copy the full SHA f05ae41View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 63b9944 - Browse repository at this point
Copy the full SHA 63b9944View commit details -
tests/extmod: Add uasyncio tests.
All .exp files are included because they require CPython 3.8 which may not always be available.
Configuration menu - View commit details
-
Copy full SHA for c4935f3 - Browse repository at this point
Copy the full SHA c4935f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d09a40 - Browse repository at this point
Copy the full SHA 5d09a40View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3667eff - Browse repository at this point
Copy the full SHA 3667effView commit details -
Configuration menu - View commit details
-
Copy full SHA for 18fa65e - Browse repository at this point
Copy the full SHA 18fa65eView commit details -
tests/multi_net: Add uasyncio test for TCP server and client.
Includes a test where the (non uasyncio) client does a RST on the connection, as a simple TCP server/client test where both sides are using uasyncio, and a test for TCP stream close then write.
Configuration menu - View commit details
-
Copy full SHA for 38904b8 - Browse repository at this point
Copy the full SHA 38904b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 081d067 - Browse repository at this point
Copy the full SHA 081d067View commit details -
extmod/uasyncio: Add optional implementation of core uasyncio in C.
Implements Task and TaskQueue classes in C, using a pairing-heap data structure. Using this reduces RAM use of each Task, and improves overall performance of the uasyncio scheduler.
Configuration menu - View commit details
-
Copy full SHA for bc009fd - Browse repository at this point
Copy the full SHA bc009fdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 91dd394 - Browse repository at this point
Copy the full SHA 91dd394View commit details -
Configuration menu - View commit details
-
Copy full SHA for c99322f - Browse repository at this point
Copy the full SHA c99322fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b68f36 - Browse repository at this point
Copy the full SHA 3b68f36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35e2dd0 - Browse repository at this point
Copy the full SHA 35e2dd0View commit details -
esp8266: Enable and freeze uasyncio.
Only included in GENERIC build.
Configuration menu - View commit details
-
Copy full SHA for 1d4d688 - Browse repository at this point
Copy the full SHA 1d4d688View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad004db - Browse repository at this point
Copy the full SHA ad004dbView commit details