{ "info": { "author": "iceboy", "author_email": "me@iceboy.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries" ], "description": "aiowrap\r\n=======\r\n\r\nSimple example\r\n--------------\r\n\r\nAssume that you have some existing libraries with blocking methods::\r\n\r\n def foo_sync(x, a, b):\r\n \"\"\"Some existing library methods. Sleeps for x seconds and returns a + b.\"\"\"\r\n time.sleep(x)\r\n return a + b\r\n\r\nAnd you are writing a program in Python3's `asyncio` framework. To use the\r\nblocking library, one way is to use a thread pool. This library provides\r\nanother option::\r\n\r\n # Wraps foo_sync() into foo_async() to use in asyncio framework.\r\n time.sleep = aiowrap.wrap_async(asyncio.sleep)\r\n foo_async = aiowrap.wrap_sync(foo_sync)\r\n\r\nNow you have an asynchronous, non-blocking version of the method, you can call\r\nit inside your favourite coroutine::\r\n\r\n async def main():\r\n print(await foo_async(1, 2, 3))\r\n\r\nThe source code of this example can be found at `example/sleep.py`.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/iceboy-sjtu/aiowrap", "keywords": "asyncio greenlet wrap", "license": "http://www.apache.org/licenses/LICENSE-2.0", "maintainer": "", "maintainer_email": "", "name": "aiowrap", "package_url": "https://pypi.org/project/aiowrap/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/aiowrap/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/iceboy-sjtu/aiowrap" }, "release_url": "https://pypi.org/project/aiowrap/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Tools for wrapping existing synchronous libraries into Python3's asyncio framework.", "version": "0.1.1" }, "last_serial": 1935686, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "951cdf7b2cc17422929ee8f1812fe963", "sha256": "d963c0885189466c8fbad5c0059e8da099d81d6572448a8cfc948dd30747bb68" }, "downloads": -1, "filename": "aiowrap-0.1.tar.gz", "has_sig": false, "md5_digest": "951cdf7b2cc17422929ee8f1812fe963", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1618, "upload_time": "2016-02-02T14:21:01", "url": "https://files.pythonhosted.org/packages/75/7a/670442c694c442301ef6c912af1c0dc4cc55f33e073bed3fe0716d9b1d0d/aiowrap-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "215990720f66ea3888b6753d52f40fc0", "sha256": "f0066270a9f61403e76d47ebb0023f793e28336e0ca45b513ebcc088cc41e22d" }, "downloads": -1, "filename": "aiowrap-0.1.1.tar.gz", "has_sig": false, "md5_digest": "215990720f66ea3888b6753d52f40fc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1622, "upload_time": "2016-02-02T14:37:26", "url": "https://files.pythonhosted.org/packages/56/b0/37b565f801d9b6f7badf16920f3c69bd2b5cb3e6964a7eb259ddb90eabaf/aiowrap-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "215990720f66ea3888b6753d52f40fc0", "sha256": "f0066270a9f61403e76d47ebb0023f793e28336e0ca45b513ebcc088cc41e22d" }, "downloads": -1, "filename": "aiowrap-0.1.1.tar.gz", "has_sig": false, "md5_digest": "215990720f66ea3888b6753d52f40fc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1622, "upload_time": "2016-02-02T14:37:26", "url": "https://files.pythonhosted.org/packages/56/b0/37b565f801d9b6f7badf16920f3c69bd2b5cb3e6964a7eb259ddb90eabaf/aiowrap-0.1.1.tar.gz" } ] }