{ "info": { "author": "Javier Ruere", "author_email": "javier@ruere.com.ar", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===================\nconcurrent-iterator\n===================\n\n.. image:: https://api.shippable.com/projects/5a9adb0da4261106000330ef/badge?branch=master\n :target: https://app.shippable.com/github/jruere/bounded-iterator\n :alt: Run Status\n\n.. image:: https://api.shippable.com/projects/5a9adb0da4261106000330ef/coverageBadge?branch=master\n :target: https://app.shippable.com/github/jruere/bounded-iterator\n :alt: Coverage Badge\n\n.. image:: https://img.shields.io/pypi/pyversions/bounded-iterator.svg\n :target: https://pypi.python.org/pypi/bounded-iterator/\n :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/l/bounded-iterator.svg\n :target: https://app.shippable.com/github/jruere/bounded-iterator\n :alt: License\n\nIntro\n=====\n\n`multiprocessing.pool.ThreadPool` and `multiprocessing.Pool` have the wonderful\n`imap` and `imap_unordered` methods which allow to consume an iterable\nincrementally and will yield results as they become available.\n\nThis is wonderful as it allows to process inputs or results larger than available\nmemory.\n\nIt has an important flaw which is that it does not limit the number of results\nthat are not consumed. This causes it to use memory without bound.\n\nThis package implements a wrapper over an iterable which will limit the number\nof results generated until they are acknowledged. It allows a number of\nmessages to be processed concurrently but no more than that.\n\nUsage\n=====\n\n.. code-block:: python\n\n it = itertools.count() # The input iterable.\n it = BoundedIterator(10, it) # Allows concurrent processing of up to 10 values.\n results = Pool().imap(str, it) # Will begin consuming `it` and producing results.\n time.sleep(5) # No matter what else we do, no more than 10 results will be available.\n for res in results: # Consume normally.\n print(res)\n it.processed() # Acknowledge a value was processed so that a new one can be generated.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jruere/bounded-iterator", "keywords": "concurrency parallelism iterator iterable multiprocessing imap", "license": "LGPLv3", "maintainer": "", "maintainer_email": "", "name": "bounded-iterator", "package_url": "https://pypi.org/project/bounded-iterator/", "platform": "", "project_url": "https://pypi.org/project/bounded-iterator/", "project_urls": { "Homepage": "https://github.com/jruere/bounded-iterator" }, "release_url": "https://pypi.org/project/bounded-iterator/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Limits the number of values generated by an iterator until acknowledged.", "version": "0.1.2" }, "last_serial": 3635922, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9d7f75af32d0ad1293222133f6f0105d", "sha256": "4f37caaba3aea4d75ce525321896f14060c7f10bedd70e778477e563aa77a687" }, "downloads": -1, "filename": "bounded_iterator-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9d7f75af32d0ad1293222133f6f0105d", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 3281, "upload_time": "2018-03-03T19:50:37", "url": "https://files.pythonhosted.org/packages/1d/5a/68e4ae2631abd09a5c32649713bbec9396e50654d3d4a04f4b2601a21128/bounded_iterator-0.1.0-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a91a7a2dde87b61e485dbff992abd41a", "sha256": "59c28e5add1c8038e2914efab6ede521d45ec4ad374d3bf97bf0e3bcf4b2603b" }, "downloads": -1, "filename": "bounded_iterator-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a91a7a2dde87b61e485dbff992abd41a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4810, "upload_time": "2018-03-03T21:11:04", "url": "https://files.pythonhosted.org/packages/5f/4e/7186a6a47bd66b0ded91c31ab92de436efcd4e10f66270ac2664dd5a175c/bounded_iterator-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "81f422a8554ca82f722c8cbcc01c2c5f", "sha256": "ed6976acaf3a38dc5de7e0f1ba1f26a9a621cb81f9d431f59a23f0b98e4fe51d" }, "downloads": -1, "filename": "bounded_iterator-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "81f422a8554ca82f722c8cbcc01c2c5f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4919, "upload_time": "2018-03-03T23:47:25", "url": "https://files.pythonhosted.org/packages/2e/ec/573e7006c85edab939c2af380efdd69c5fcef23690d405609d4e3e3036a5/bounded_iterator-0.1.2-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "81f422a8554ca82f722c8cbcc01c2c5f", "sha256": "ed6976acaf3a38dc5de7e0f1ba1f26a9a621cb81f9d431f59a23f0b98e4fe51d" }, "downloads": -1, "filename": "bounded_iterator-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "81f422a8554ca82f722c8cbcc01c2c5f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 4919, "upload_time": "2018-03-03T23:47:25", "url": "https://files.pythonhosted.org/packages/2e/ec/573e7006c85edab939c2af380efdd69c5fcef23690d405609d4e3e3036a5/bounded_iterator-0.1.2-py2.py3-none-any.whl" } ] }