diff --git a/uasyncio/README.rst b/uasyncio/README.rst new file mode 100644 index 00000000..ee9012a9 --- /dev/null +++ b/uasyncio/README.rst @@ -0,0 +1,37 @@ +uasyncio +======== + +uasyncio is MicroPython's asynchronous sheduling library, roughly +modeled after CPython's asyncio. + +uasyncio doesn't use naive always-iterating scheduling algorithm, +but performs a real time-based scheduling, which allows it (and +thus the whole system) to sleep when there is nothing to do (actual +implementation of that depends on I/O scheduling algorithm which +actually performs the wait operation). + +Major conceptual differences to asyncio: + +* Avoids defining a notion of Future, and especially wrapping coroutines + in Futures, like CPython asyncio does. uasyncio works directly with + coroutines (and callbacks). +* uasyncio uses wrap-around millisecond timebase (as native to all + MicroPython ports.) +* Instead of single large package, number of subpackages are provided + (each installable separately). + +Specific differences: + +* For millisecond scheduling, ``loop.call_later_ms()`` and + ``uasyncio.sleep_ms()`` are provided. +* As there's no monotonic time, ``loop.call_at()`` is not provided. + Instead, there's ``loop.call_at_()`` which is considered an internal + function and has slightly different signature. +* ``call_*`` funcions don't return Handle and callbacks scheduled by + them aren't cancellable. If they need to be cancellable, they should + accept an object as an argument, and a "cancel" flag should be set + in the object, for a callback to test. +* ``Future`` object is not available. +* ``ensure_future()`` and ``Task()`` perform just scheduling operations + and return a native coroutine, not Future/Task objects. +* Some other functions are not (yet) implemented. diff --git a/uasyncio/metadata.txt b/uasyncio/metadata.txt index 6ffe4291..379a86fa 100644 --- a/uasyncio/metadata.txt +++ b/uasyncio/metadata.txt @@ -1,6 +1,7 @@ srctype = micropython-lib type = package -version = 1.2.2 +version = 1.2.3 author = Paul Sokolovsky -long_desc = Lightweight asyncio-like library built around native Python coroutines, not around un-Python devices like callback mess. +desc = Lightweight asyncio-like library for MicroPython, built around native Python coroutines. +long_desc = README.rst depends = uasyncio.core diff --git a/uasyncio/setup.py b/uasyncio/setup.py index 0908f715..a15a3dbe 100644 --- a/uasyncio/setup.py +++ b/uasyncio/setup.py @@ -7,9 +7,9 @@ sys.path.append("..") import optimize_upip setup(name='micropython-uasyncio', - version='1.2.2', - description='uasyncio module for MicroPython', - long_description='Lightweight asyncio-like library built around native Python coroutines, not around un-Python devices like callback mess.', + version='1.2.3', + description='Lightweight asyncio-like library for MicroPython, built around native Python coroutines.', + long_description=open('README.rst').read(), url='https://github.com/micropython/micropython-lib', author='Paul Sokolovsky', author_email='micro-python@googlegroups.com',