{ "info": { "author": "John Reese", "author_email": "john@noswap.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: AsyncIO", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries" ], "description": "aiomultiprocess\n===============\n\nTake a modern Python codebase to the next level of performance.\n\n[![build status](https://travis-ci.org/jreese/aiomultiprocess.svg?branch=master)](https://travis-ci.org/jreese/aiomultiprocess)\n[![windows build status](https://img.shields.io/appveyor/ci/jreese/aiomultiprocess.svg?branch=master&label=windows)](https://ci.appveyor.com/project/jreese/aiomultiprocess)\n[![code coverage](https://img.shields.io/codecov/c/gh/jreese/aiomultiprocess)](https://codecov.io/gh/jreese/aiomultiprocess)\n[![version](https://img.shields.io/pypi/v/aiomultiprocess.svg)](https://pypi.org/project/aiomultiprocess)\n[![license](https://img.shields.io/pypi/l/aiomultiprocess.svg)](https://github.com/jreese/aiomultiprocess/blob/master/LICENSE)\n[![code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nOn their own, AsyncIO and multiprocessing are useful, but limited:\nAsyncIO still can't exceed the speed of GIL, and multiprocessing only works on\none task at a time. But together, they can fully realize their true potential.\n\naiomultiprocess presents a simple interface, while running a full AsyncIO event\nloop on each child process, enabling levels of concurrency never before seen\nin a Python application. Each child process can execute multiple coroutines\nat once, limited only by the workload and number of cores available.\n\nGathering tens of thousands of network requests in seconds is as easy as:\n\n```python\nasync with Pool() as pool:\n results = await pool.map(, )\n```\n\nFor more context, watch the PyCon US 2018 talk about aiomultiprocess,\n[\"Thinking Outside the GIL\"][pycon-2018]:\n\n> [![IMAGE ALT TEXT](http://img.youtube.com/vi/0kXaLh8Fz3k/0.jpg)](http://www.youtube.com/watch?v=0kXaLh8Fz3k \"PyCon 2018 - John Reese - Thinking Outside the GIL with AsyncIO and Multiprocessing\")\n\nSlides available at [Speaker Deck](https://speakerdeck.com/jreese/thinking-outside-the-gil-2).\n\n\nInstall\n-------\n\naiomultiprocess requires Python 3.6 or newer.\nYou can install it from PyPI:\n\n```bash session\n$ pip3 install aiomultiprocess\n```\n\n\nUsage\n-----\n\nMost of aiomultiprocess mimics the standard multiprocessing module whenever\npossible, while accounting for places that benefit from async functionality.\n\nExecuting a coroutine on a child process is as simple as:\n\n```python\nimport asyncio\nfrom aiohttp import request\nfrom aiomultiprocess import Process\n\nasync def put(url, params):\n async with request(\"PUT\", url, params=params) as response:\n pass\n\nasync def main():\n p = Process(target=put, args=(\"https://jreese.sh\", {}))\n await p\n\nasyncio.run(main())\n```\n\nIf you want to get results back from that coroutine, `Worker` makes that available:\n\n```python\nimport asyncio\nfrom aiohttp import request\nfrom aiomultiprocess import Worker\n\nasync def get(url):\n async with request(\"GET\", url) as response:\n return await response.text(\"utf-8\")\n\nasync def main():\n p = Worker(target=get, args=(\"https://jreese.sh\", {}))\n response = await p\n\nasyncio.run(main())\n```\n\nIf you want a managed pool of worker processes, then use `Pool`:\n\n```python\nimport asyncio\nfrom aiohttp import request\nfrom aiomultiprocess import Pool\n\nasync def get(url):\n async with request(\"GET\", url) as response:\n return await response.text(\"utf-8\")\n\nasync def main():\n urls = [\"https://jreese.sh\", ...]\n async with Pool() as pool:\n result = await pool.map(get, urls)\n\nasyncio.run(main())\n```\n\n\nLicense\n-------\n\naiomultiprocess is copyright [John Reese](https://jreese.sh), and licensed under\nthe MIT license. I am providing code in this repository to you under an open\nsource license. This is my personal repository; the license you receive to\nmy code is from me and not from my employer. See the `LICENSE` file for details.\n\n\n[pycon-2018]: https://www.youtube.com/watch?v=0kXaLh8Fz3k", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jreese/aiomultiprocess", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aiomultiprocess", "package_url": "https://pypi.org/project/aiomultiprocess/", "platform": "", "project_url": "https://pypi.org/project/aiomultiprocess/", "project_urls": { "Homepage": "https://github.com/jreese/aiomultiprocess" }, "release_url": "https://pypi.org/project/aiomultiprocess/0.6.1/", "requires_dist": null, "requires_python": ">=3.6", "summary": "asyncio version of the standard multiprocessing module", "version": "0.6.1" }, "last_serial": 5701336, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5d5fd8c6bc17a74e54e9962b51b777f2", "sha256": "ebd2a6478c3216f5e34e2b4d454a12d1947dee5f9c03f358e09e025fc508d5e2" }, "downloads": -1, "filename": "aiomultiprocess-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5d5fd8c6bc17a74e54e9962b51b777f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2308, "upload_time": "2018-04-08T20:09:39", "url": "https://files.pythonhosted.org/packages/ff/af/b448fb4a9db5e1bcdb63cfe198c3d26c8ec5c50a1dcae2ed407cda282ec9/aiomultiprocess-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f79e1a9bd7a164b89065b267b0ecc340", "sha256": "0accab24fcc4d50452dee8f7bf53657db5ccd5ed489c09bbad0e74a7572250c2" }, "downloads": -1, "filename": "aiomultiprocess-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f79e1a9bd7a164b89065b267b0ecc340", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5354, "upload_time": "2018-04-09T04:40:04", "url": "https://files.pythonhosted.org/packages/f1/08/348755b5254c7e5236510aaa56d81b800182eb63a99224b25fc8479fd244/aiomultiprocess-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6b7ae3b0817c145e34a6b45386e43f4d", "sha256": "0e4529022ec73613408f4b05e4f92d82e990fcc4fbf794bb64a47d0651110c60" }, "downloads": -1, "filename": "aiomultiprocess-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6b7ae3b0817c145e34a6b45386e43f4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6480, "upload_time": "2018-04-10T06:53:15", "url": "https://files.pythonhosted.org/packages/78/e5/02224329f484a911055bc6ccc9ff5abee355a83121c5a25ad34b6f6df552/aiomultiprocess-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "a560140dd5017a982844087cdb3157c5", "sha256": "1d28cca8dae4764a39b9f13944951626a3e011cb941573b83a48b6aa21278a16" }, "downloads": -1, "filename": "aiomultiprocess-0.4.0.tar.gz", "has_sig": false, "md5_digest": "a560140dd5017a982844087cdb3157c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6798, "upload_time": "2018-05-15T18:20:35", "url": "https://files.pythonhosted.org/packages/b1/cd/c3eafa1556fea1064dee4766c5bb0c5c3ecbb76fa305e0f68885d6b9aa30/aiomultiprocess-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0521f456aa99c4d0b399f6d0f31efab6", "sha256": "98de93bed092aa4cf7986ff9be72c6a0ec56ffb0d9dfb9320786a10bedace0bc" }, "downloads": -1, "filename": "aiomultiprocess-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0521f456aa99c4d0b399f6d0f31efab6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7242, "upload_time": "2018-12-28T00:59:45", "url": "https://files.pythonhosted.org/packages/8d/57/04580f7b361fc41c28311e80ae59b54aa29cc04ca8a16840edc1107adfd1/aiomultiprocess-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "056133793dc6195b1512f31e087ae43d", "sha256": "fd9b616d5145ac2b01f315725277231ffad7e56eb6675885598f6fe861ef9fa3" }, "downloads": -1, "filename": "aiomultiprocess-0.6.0.tar.gz", "has_sig": false, "md5_digest": "056133793dc6195b1512f31e087ae43d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9276, "upload_time": "2019-07-25T03:50:01", "url": "https://files.pythonhosted.org/packages/09/73/6f98f7b936d6beffe11786db99d7c771a75bfcf0e9d824b995497c22c131/aiomultiprocess-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "9fc012efd609dad205d0b839ec73f918", "sha256": "c704383be74ccb806e2617cb3bb6a5faa1774b1c6643d62785c332eb6da9e742" }, "downloads": -1, "filename": "aiomultiprocess-0.6.1.tar.gz", "has_sig": false, "md5_digest": "9fc012efd609dad205d0b839ec73f918", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9691, "upload_time": "2019-08-20T03:29:21", "url": "https://files.pythonhosted.org/packages/a6/14/041c179f38a86379417ee572b65ecde85ff023298a0d07f167a64308f0c9/aiomultiprocess-0.6.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9fc012efd609dad205d0b839ec73f918", "sha256": "c704383be74ccb806e2617cb3bb6a5faa1774b1c6643d62785c332eb6da9e742" }, "downloads": -1, "filename": "aiomultiprocess-0.6.1.tar.gz", "has_sig": false, "md5_digest": "9fc012efd609dad205d0b839ec73f918", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9691, "upload_time": "2019-08-20T03:29:21", "url": "https://files.pythonhosted.org/packages/a6/14/041c179f38a86379417ee572b65ecde85ff023298a0d07f167a64308f0c9/aiomultiprocess-0.6.1.tar.gz" } ] }