{ "info": { "author": "Daniel Lupu", "author_email": "dflupu@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# aioconcurrency [![Build Status](https://travis-ci.org/dflupu/aioconcurrency.svg?branch=master)](https://travis-ci.org/dflupu/aioconcurrency)\n\nRun a coroutine with each item in an iterable, concurrently\n\n## Install\n\n`pip install aioconcurrency`\n\n## Usage example\n\n```\nimport aioconcurrency\n\nitems = [1, 2, 3, 4]\nasync def f(item):\n return item * 2\n\nasync def main():\n await aioconcurrency.map(items, f, concurrency=2) # Returns [2, 4, 6, 8]\n\n async for result in aioconcurrency.each(items, f, concurrency=2):\n print(result) # Prints 2 4 6 8 in random order\n```\n\n## Api\n\n### aioconcurrency.map\n\nRuns the given coroutine concurrently with each item in an iterable.\nThe list of the return values will be ordered as if ran serially.\n\n`items`\n\nAn iterable object.\n\n`coro`\n\nCoroutine to feed each item to.\n\n`optional: concurrency`\n\nNumber of concurrent runs of `coro`. Defaults to `aioconcurrency.Infinite`.\n\n`optional: executor`\n\nCan be an instance of ThreadPoolExecutor.\n\n`optional: loop`\n\nThe asyncio event loop that will be used.\n\n### aioconcurrency.each\n\nRuns the given coroutine concurrently with each item in an iterable.\nReturns a generator that may be used to iterate over the return values. The generator yields values as soon as they are available.\n\n`items`\n\nAn iterable object. If an `asyncio.Queue` is passed then `.each` will read from it indefinitely.\n\n`coro`\n\nCoroutine to feed each item to.\n\n`optional: concurrency`\n\nNumber of concurrent runs of `coro`. Defaults to `aioconcurrency.Infinite`.\n\n`optional: executor`\n\nCan be an instance of ThreadPoolExecutor.\n\n`optional: loop`\n\nThe asyncio event loop that will be used.\n\n`optional: discard_results`\n\nIf truthy, discard the return value of `coro`. Defaults to false.\n\n`property: wait()`\n\nCoroutine. May be used to wait until all items have been processed.\n\n`property: processed_count`\n\nThe number of items that have been processed so far.\n\n`property: cancel()`\n\nCancels all runs of `coro`.\n\n## Tests\n\n`pytest .`", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/dflupu/aioconcurrency", "keywords": "asyncio aio each map limit semaphore concurrency generator synchronization", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "aioconcurrency", "package_url": "https://pypi.org/project/aioconcurrency/", "platform": "", "project_url": "https://pypi.org/project/aioconcurrency/", "project_urls": { "Homepage": "http://github.com/dflupu/aioconcurrency" }, "release_url": "https://pypi.org/project/aioconcurrency/0.4.1/", "requires_dist": null, "requires_python": "", "summary": "Run a coroutine with each item in an iterable, concurrently", "version": "0.4.1" }, "last_serial": 4821065, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7a87e555b7c047ed5ad23ba6d692e8a7", "sha256": "e21506fa6c3aab1cac7254cf3f45e35409fba0f5b0f2d5bf4531fcd9bc63460d" }, "downloads": -1, "filename": "aioconcurrency-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7a87e555b7c047ed5ad23ba6d692e8a7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3075, "upload_time": "2019-02-10T21:55:22", "url": "https://files.pythonhosted.org/packages/3a/91/00e8e6e48111e3b8f7684fd2d2a1f0289c5412fbc479a58fe5c2d26676e7/aioconcurrency-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d2ada1bc93fd498ba290874022333ed7", "sha256": "83c85e5350ffb1d9e33413527e7441910b9b6273250c0248fb038038efafd43e" }, "downloads": -1, "filename": "aioconcurrency-0.1.1.tar.gz", "has_sig": false, "md5_digest": "d2ada1bc93fd498ba290874022333ed7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3135, "upload_time": "2019-02-10T22:23:36", "url": "https://files.pythonhosted.org/packages/75/4c/ce60126827af6090592d48c572d5fbc354a75c4a4c235b4f1220d499d2c3/aioconcurrency-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "82aed7d2d0ca0573b50581bf3817c80d", "sha256": "348a3a8e0f73af659604d44fd9db0409f740fd95830220e7d21223ac1efde298" }, "downloads": -1, "filename": "aioconcurrency-0.1.2.tar.gz", "has_sig": false, "md5_digest": "82aed7d2d0ca0573b50581bf3817c80d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3188, "upload_time": "2019-02-10T23:12:15", "url": "https://files.pythonhosted.org/packages/cc/4a/edab8470fb19e0eb09c0ac8f5ad78192620671b4e5c10233096b7f481e31/aioconcurrency-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "7eef98d6e70980e805674535d1edfe35", "sha256": "3c627ce7d8524d8805bd4d09f851eff2c47595d73cf4ac9110b103aeb1e8db71" }, "downloads": -1, "filename": "aioconcurrency-0.1.3.tar.gz", "has_sig": false, "md5_digest": "7eef98d6e70980e805674535d1edfe35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3538, "upload_time": "2019-02-11T22:11:11", "url": "https://files.pythonhosted.org/packages/58/53/eded7bfaf2a0e3953fa352bb31df6028b35f78feba3771c18706d4b97d7b/aioconcurrency-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5f814156dff0610f7f60dd4cee5b78a0", "sha256": "d17bd407c3879c9e5f5351282ee6f49b720a03b9b77e615b1cd34b89615c422b" }, "downloads": -1, "filename": "aioconcurrency-0.2.0.tar.gz", "has_sig": false, "md5_digest": "5f814156dff0610f7f60dd4cee5b78a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3547, "upload_time": "2019-02-13T12:09:55", "url": "https://files.pythonhosted.org/packages/55/0e/aeae7d8ace82f1d0b9ae6e1c3ca196bd7aedced330aae2a8fc8f420c4fc3/aioconcurrency-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "28414cff12b98373dd0750aad34e1a7b", "sha256": "95ca23dc5127269f9f271c5ac60761ee73c28fa61622fabf2dca275715c7045d" }, "downloads": -1, "filename": "aioconcurrency-0.3.0.tar.gz", "has_sig": false, "md5_digest": "28414cff12b98373dd0750aad34e1a7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3776, "upload_time": "2019-02-13T13:38:08", "url": "https://files.pythonhosted.org/packages/86/06/221efc46bf777e5aa8d60ce031edbbab856ea5530cac62b557dda7835329/aioconcurrency-0.3.0.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "4a2ee53b2a7c98b8ac689a86b43f0d77", "sha256": "0b4544c4f813d54476d4750740f2ae3c4c0eba7d106290bb343e13d2f991a77a" }, "downloads": -1, "filename": "aioconcurrency-0.3.2.tar.gz", "has_sig": false, "md5_digest": "4a2ee53b2a7c98b8ac689a86b43f0d77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3803, "upload_time": "2019-02-13T14:51:07", "url": "https://files.pythonhosted.org/packages/88/04/2632bbc06eb1585f0dcf7d898ac6f3b8760a7c89a06e55b2b17d483d6797/aioconcurrency-0.3.2.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "2a21301ccf604ee581d465157b440e65", "sha256": "42b73ef039aa477f3e27f2d1e307794d85a37f56aba729433bd65fea88221832" }, "downloads": -1, "filename": "aioconcurrency-0.4.0.tar.gz", "has_sig": false, "md5_digest": "2a21301ccf604ee581d465157b440e65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3871, "upload_time": "2019-02-14T11:59:55", "url": "https://files.pythonhosted.org/packages/3b/f3/90949b4343297de623a2ef7aa31aa4f3d3ad0fdc0d74e12d6dc67aca5d23/aioconcurrency-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "2796555738d41d9bea405c6391f52894", "sha256": "afed2a53def051cfee8f7e437e0b96bb9a8fca33ae6f82b9d95bd0405b6befcc" }, "downloads": -1, "filename": "aioconcurrency-0.4.1.tar.gz", "has_sig": false, "md5_digest": "2796555738d41d9bea405c6391f52894", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3870, "upload_time": "2019-02-14T16:00:55", "url": "https://files.pythonhosted.org/packages/6d/e2/a31ade02d6471da6d8fa07d2b43c1b8a93779abd884a97d1f2d06f3ba0d3/aioconcurrency-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2796555738d41d9bea405c6391f52894", "sha256": "afed2a53def051cfee8f7e437e0b96bb9a8fca33ae6f82b9d95bd0405b6befcc" }, "downloads": -1, "filename": "aioconcurrency-0.4.1.tar.gz", "has_sig": false, "md5_digest": "2796555738d41d9bea405c6391f52894", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3870, "upload_time": "2019-02-14T16:00:55", "url": "https://files.pythonhosted.org/packages/6d/e2/a31ade02d6471da6d8fa07d2b43c1b8a93779abd884a97d1f2d06f3ba0d3/aioconcurrency-0.4.1.tar.gz" } ] }