{ "info": { "author": "Paul Sokolovsky", "author_email": "micropython-lib@googlegroups.com", "bugtrack_url": null, "classifiers": [], "description": "uasyncio\n========\n\nuasyncio is a minimalist asynchronous scheduling library, roughly\nmodeled after CPython's asyncio. uasyncio is intended to be used with\n`Pycopy `_, an advanced fork\nof MicroPython.\n\nuasyncio doesn't use naive always-iterating scheduling algorithm,\nbut performs a real time-based scheduling, which allows it (and\nthus the whole system) to sleep when there is nothing to do (actual\nimplementation of that depends on I/O scheduling algorithm which\nactually performs the wait operation).\n\nMajor conceptual differences to asyncio:\n\n* Avoids defining a notion of Future, and especially wrapping coroutines\n in Futures, like CPython asyncio does. uasyncio works directly with\n coroutines (and callbacks).\n* Methods provided are more consistently coroutines.\n* uasyncio uses wrap-around millisecond timebase (as native to all\n MicroPython ports.)\n* Instead of single large package, number of subpackages are provided\n (each installable separately).\n\nSpecific differences:\n\n* For millisecond scheduling, ``loop.call_later_ms()`` and\n ``uasyncio.sleep_ms()`` are provided.\n* As there's no monotonic time, ``loop.call_at()`` is not provided.\n Instead, there's ``loop.call_at_()`` which is considered an internal\n function and has slightly different signature.\n* ``call_*`` funcions don't return Handle and callbacks scheduled by\n them aren't cancellable. If they need to be cancellable, they should\n accept an object as an argument, and a \"cancel\" flag should be set\n in the object, for a callback to test.\n* ``Future`` object is not available.\n* ``ensure_future()`` and ``Task()`` perform just scheduling operations\n and return a native coroutine, not Future/Task objects.\n* Some other functions are not (yet) implemented.\n* StreamWriter method(s) are coroutines. While in CPython asyncio,\n StreamWriter.write() is a normal function (which potentially buffers\n unlimited amount of data), uasyncio offers coroutine StreamWriter.awrite()\n instead. Also, both StreamReader and StreamWriter have .aclose()\n coroutine method.\n\nRequirements\n------------\n\nAt the time of writing, uasyncio requires `Pycopy `_\nproject to run.\n\nAdvanced topics\n---------------\n\nTerminology:\n\n* Task - a top-level coroutine, scheduled in an event loop using its\n create_task() method. (Or, as a uasyncio extension, a couroutine\n object passed to the \"yield\" statement by another coroutine, this\n is equivalent to the create_task() call). Different tasks run\n concurrently in a cooperative manner. Each task can also call\n another coroutine recursively (in which case calling coroutine\n will \"await\" (literally) completion of the called coroutine). More\n formally, a task is a coroutine call tree routed in the top-level\n coroutine passed to create_tast(), and identified by it.\n\nNotes on resource sharing between the tasks\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nJust as sharing resources between preemptive threads, sharing resources\nbetween uasyncio cooperative tasks has its peculiarities and limitations.\nActually, due to I/O scheduling implementation, there're additional\npeculiarities to consider. But let's start with stating that resource\nsharing between tasks/threads is usually an error. For example, if both\ntasks write to the resource, their would be interspersed, possibly in\nan unpredictable way. Reading is even more problematic: different tasks\nmay get partial input, or one can get all and other none at all. If tasks\nimplement some protocol, i.e. I/O dialog, that would lead to incorrect\nbehavior and/or deadlock. Thus, the rule is: don't share the same I/O\nobjects, in particular StreamReader and StreamWriter objects, among\ndifferent tasks. (Of course, they can be passed to subcourotines of the\ncurrent task).\n\nAn extreme case of the above is trying to use reader part of the same\nStreamReader/StreamWriter part in one task, while writer - in another.\nThis may be only speculative use, and isn't supported either:\nStreamReader and StreamWriter represent half-duplex parts of the same\nI/O stream, and both must be used within one task. If you need something\nlike the above, you need to create different StreamReader/Writer pairs\n(likely, from different underlying I/O objects).\n\nWhile StreamReader/StreamWriter are given as examples above, it applies\nto other I/O objects too. For example, uasyncio.udp socket just the\nsame should not be passed to 2 different tasks. If you need this, 2\ndifferent sockets should be used.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pfalcon/micropython-lib", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "micropython-uasyncio", "package_url": "https://pypi.org/project/micropython-uasyncio/", "platform": "", "project_url": "https://pypi.org/project/micropython-uasyncio/", "project_urls": { "Homepage": "https://github.com/pfalcon/micropython-lib" }, "release_url": "https://pypi.org/project/micropython-uasyncio/3.1.1/", "requires_dist": null, "requires_python": "", "summary": "Lightweight asyncio-like library for MicroPython, built around native Python coroutines.", "version": "3.1.1" }, "last_serial": 5660174, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "fd6c39aa2160f7461d630f47e0074244", "sha256": "67caaaee93412afa1f6e6bba218b580c6c2f3bac25a92bd16394a83059df61cd" }, "downloads": -1, "filename": "micropython-uasyncio-1.0.1.tar.gz", "has_sig": false, "md5_digest": "fd6c39aa2160f7461d630f47e0074244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2251, "upload_time": "2016-12-30T19:33:09", "url": "https://files.pythonhosted.org/packages/e5/51/3c6ea8ab13a41105c038fe02732cbe9311a01d2ba94c612c73a13394e9fc/micropython-uasyncio-1.0.1.tar.gz" } ], "1.2.4": [ { "comment_text": "", "digests": { "md5": "34e4c8a71389be0027ec48b8e4dad270", "sha256": "ecc8bc70a401b69bbd75fe2a2b3c19cac9f2d36678c4701e802460f9ff8ef07e" }, "downloads": -1, "filename": "micropython-uasyncio-1.2.4.tar.gz", "has_sig": false, "md5_digest": "34e4c8a71389be0027ec48b8e4dad270", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3419, "upload_time": "2017-11-05T15:52:52", "url": "https://files.pythonhosted.org/packages/49/91/3228f62e1d7238d416b37a04cba1427fb8b4abe3666aff6d8bd1f68cd0ad/micropython-uasyncio-1.2.4.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "c8a62c4d5891078838db59f0d17c3351", "sha256": "d05cac15d14ecdd214aa8d40bc2e7b1611405bb81ecc931c46fca2f86532fe54" }, "downloads": -1, "filename": "micropython-uasyncio-1.3.tar.gz", "has_sig": false, "md5_digest": "c8a62c4d5891078838db59f0d17c3351", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3734, "upload_time": "2017-12-09T16:09:28", "url": "https://files.pythonhosted.org/packages/e2/5d/9791b160ba2149dfa0d2df256779afcfdab7e3e646ab0cd760b7f1f50a2d/micropython-uasyncio-1.3.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "0e84c16d3a6529154180e9d26a8a672e", "sha256": "ba83d26a7867106c1f48a15965c8535f4b9c3f07c6c7e141ad884f82553fa9cc" }, "downloads": -1, "filename": "micropython-uasyncio-2.1.tar.gz", "has_sig": false, "md5_digest": "0e84c16d3a6529154180e9d26a8a672e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4866, "upload_time": "2018-09-28T22:14:05", "url": "https://files.pythonhosted.org/packages/3d/4e/aa4345eb0fc10d911d179b33126c0a0d4c09558246c8f84b9f99898008a4/micropython-uasyncio-2.1.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "a4ea02d9cca67b73a71a11ddac813ac2", "sha256": "8d663e4473db40c880699a552b9f7f8735104b11d43e117d580841789b2ac1c2" }, "downloads": -1, "filename": "micropython-uasyncio-2.1.1.tar.gz", "has_sig": false, "md5_digest": "a4ea02d9cca67b73a71a11ddac813ac2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4876, "upload_time": "2018-11-03T11:53:48", "url": "https://files.pythonhosted.org/packages/0c/33/cbd1ee245621dab9952ebd1d3be840e6acd66e847b33ea88a7f015d2b952/micropython-uasyncio-2.1.1.tar.gz" } ], "3.0": [ { "comment_text": "", "digests": { "md5": "77ed03533c6c1a3add7328a7adff86c5", "sha256": "ee4281dc61a1251d2a88e54bf5ecd20c0377cab8b57909274db541759089565e" }, "downloads": -1, "filename": "micropython-uasyncio-3.0.tar.gz", "has_sig": false, "md5_digest": "77ed03533c6c1a3add7328a7adff86c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4998, "upload_time": "2019-04-28T22:00:13", "url": "https://files.pythonhosted.org/packages/78/ca/97463846964896547545557123c76808402eef3cb08d0fba9f169d65cec3/micropython-uasyncio-3.0.tar.gz" } ], "3.0.1": [ { "comment_text": "", "digests": { "md5": "9cf0737e6b4b27909d690502cbacf9b6", "sha256": "e62d67c0987b79372e1d50973412f56ee20e9cc2e26255937432683738745f69" }, "downloads": -1, "filename": "micropython-uasyncio-3.0.1.tar.gz", "has_sig": false, "md5_digest": "9cf0737e6b4b27909d690502cbacf9b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5021, "upload_time": "2019-05-06T19:32:28", "url": "https://files.pythonhosted.org/packages/82/15/a9882c08b594e7c8bc7ba36952786040655f1eb5c1effd1060d943b626dc/micropython-uasyncio-3.0.1.tar.gz" } ], "3.1": [ { "comment_text": "", "digests": { "md5": "b826315f9cd9676a618cc7b26604c5ae", "sha256": "ba1dd64c044ee2d9f5aec0f7c22feb6472a708925aaca3a0e3f465c801f9aeaa" }, "downloads": -1, "filename": "micropython-uasyncio-3.1.tar.gz", "has_sig": false, "md5_digest": "b826315f9cd9676a618cc7b26604c5ae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5068, "upload_time": "2019-06-15T20:13:40", "url": "https://files.pythonhosted.org/packages/5b/6f/ceab84bdb77b2cfcf6ad6c3ccbb0f3caf13079485d7c46a4ee8d32d2c0ee/micropython-uasyncio-3.1.tar.gz" } ], "3.1.1": [ { "comment_text": "", "digests": { "md5": "ba22a2fb6be1f5af5afb237b2ff17714", "sha256": "6e4b3c7cc1db582c894088e7baa997c09954dd4d7e83d5d8bb17974a5b982aef" }, "downloads": -1, "filename": "micropython-uasyncio-3.1.1.tar.gz", "has_sig": false, "md5_digest": "ba22a2fb6be1f5af5afb237b2ff17714", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5071, "upload_time": "2019-06-15T20:26:38", "url": "https://files.pythonhosted.org/packages/08/ae/02157a6c3a8971df47563bf7f2aedae0922022bf5341f62c617b31bf8364/micropython-uasyncio-3.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba22a2fb6be1f5af5afb237b2ff17714", "sha256": "6e4b3c7cc1db582c894088e7baa997c09954dd4d7e83d5d8bb17974a5b982aef" }, "downloads": -1, "filename": "micropython-uasyncio-3.1.1.tar.gz", "has_sig": false, "md5_digest": "ba22a2fb6be1f5af5afb237b2ff17714", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5071, "upload_time": "2019-06-15T20:26:38", "url": "https://files.pythonhosted.org/packages/08/ae/02157a6c3a8971df47563bf7f2aedae0922022bf5341f62c617b31bf8364/micropython-uasyncio-3.1.1.tar.gz" } ] }