{ "info": { "author": "Max Zheng", "author_email": "maxzheng.os @t gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "coworker\n==============\n\nGeneric worker that performs concurrent tasks using coroutine.\n\nQuick Start Tutorial\n====================\n\nDefine how a task is performed and create the worker:\n\n.. code-block:: python\n\n from coworker import Coworker\n\n class SquareWorker(Coworker):\n async def do_task(self, task):\n return task * task\n\n worker = SquareWorker(max_concurrency=5) # Only 5 tasks will run concurrently\n # As do_task is fast, 35,000 tasks can be done in 1 second.\n\nTo run in the background forever and add tasks:\n\n.. code-block:: python\n\n import asyncio\n\n async def background_worker_example():\n # Start worker / Run in background\n asyncio.ensure_future(worker.start())\n\n # Mulitiple tasks\n tasks = list(range(100))\n results = await asyncio.gather(*worker.add_tasks(tasks))\n print(results) # results = [0, 1, 4, 9, ...]\n\n # Single task\n result = await worker.add_tasks(2)\n print(result) # result = 4\n\n # Stop worker\n await worker.stop()\n\n # Run async usage example\n asyncio.get_event_loop().run_until_complete(background_worker_example())\n\n\nTo run for a list of tasks and stop worker when finished:\n\n.. code-block:: python\n\n task_futures = asyncio.get_event_loop().run_until_complete(worker.start([1, 2, 3]))\n print([t.result() for t in task_futures]) # [1, 4, 9]\n\n\nLinks & Contact Info\n====================\n\n| Documentation: http://coworker.readthedocs.org\n|\n| PyPI Package: https://pypi.python.org/pypi/coworker\n| GitHub Source: https://github.com/maxzheng/coworker\n| Report Issues/Bugs: https://github.com/maxzheng/coworker/issues\n|\n| Connect: https://www.linkedin.com/in/maxzheng\n| Contact: maxzheng.os @t gmail.com\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/maxzheng/coworker", "keywords": "coroutine concurrent worker", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "coworker", "package_url": "https://pypi.org/project/coworker/", "platform": "", "project_url": "https://pypi.org/project/coworker/", "project_urls": { "Homepage": "https://github.com/maxzheng/coworker" }, "release_url": "https://pypi.org/project/coworker/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Generic worker that performs concurrent tasks using coroutine.", "version": "1.0.1" }, "last_serial": 3934822, "releases": { "0.0.1": [], "0.0.2": [ { "comment_text": "", "digests": { "md5": "e9d72de3a8644875177e0593f9b15afd", "sha256": "ab5dd4ffa0ac26013b923ee952d3e2fcd5e8287fd8fed653bf873729601a7170" }, "downloads": -1, "filename": "coworker-0.0.2.tar.gz", "has_sig": false, "md5_digest": "e9d72de3a8644875177e0593f9b15afd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11791, "upload_time": "2016-09-24T02:02:57", "url": "https://files.pythonhosted.org/packages/ae/87/8327fa7754a791bcb620bea9107936bf5c73dc3337ff4b74fd8b677fa8d0/coworker-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "04d0c46af5e0ee6b7e767ae7b50dcb7c", "sha256": "85b86f323ba40fa0ad90149b92df31067ac8d5fba5e5f521607b65883d67369d" }, "downloads": -1, "filename": "coworker-0.0.3.tar.gz", "has_sig": false, "md5_digest": "04d0c46af5e0ee6b7e767ae7b50dcb7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11804, "upload_time": "2016-09-24T02:10:57", "url": "https://files.pythonhosted.org/packages/d5/31/cbe07696944bb42b1479ce98d39f8bb468f87d4b168aafde986eb7f4065a/coworker-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "fa526f28130ccd51eeb2c91fdd3154e1", "sha256": "e270e96d2e97227b8c2830145f7cb279d8fe1c9df8b746f967cce492cd99ff7f" }, "downloads": -1, "filename": "coworker-0.0.4.tar.gz", "has_sig": false, "md5_digest": "fa526f28130ccd51eeb2c91fdd3154e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12533, "upload_time": "2016-09-27T08:02:40", "url": "https://files.pythonhosted.org/packages/c1/65/08881c60f0d190f6cc7847c1e6f8053bcc129c360f6f32f55ee13c794c26/coworker-0.0.4.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "ea04f6d6a75efda4e832440018c63d87", "sha256": "00f22005e56619df6437abb01e314dbec6375e600fd005946e9efc5305b6b07a" }, "downloads": -1, "filename": "coworker-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ea04f6d6a75efda4e832440018c63d87", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12550, "upload_time": "2016-09-27T08:13:29", "url": "https://files.pythonhosted.org/packages/03/e3/c4ea3b77c3ce5417786656facc918c351fa0adbbb67a18eeb23127b4a95a/coworker-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "47369ea40cea0bf9006315cadc7c782c", "sha256": "af0810e63a52d200534c16f2498d93e51c18cd9fc74be1cc52b9b99863c96bac" }, "downloads": -1, "filename": "coworker-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "47369ea40cea0bf9006315cadc7c782c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4445, "upload_time": "2018-06-06T05:55:28", "url": "https://files.pythonhosted.org/packages/81/a6/beb088ae555a0589d22bef510e177be48e154f8ffdfa148f5ff688825f77/coworker-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f3d71da2fdfefe410512a75e04b2008d", "sha256": "2cfa8c72022bd72e65dc520d354637270353d6090b4592f2ed30d3d901ebc2b5" }, "downloads": -1, "filename": "coworker-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f3d71da2fdfefe410512a75e04b2008d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13096, "upload_time": "2018-06-06T05:55:30", "url": "https://files.pythonhosted.org/packages/44/d8/6c8ffcaf2255d4648b6df87910487d251510ee73ee560cf1ca31d3e02797/coworker-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47369ea40cea0bf9006315cadc7c782c", "sha256": "af0810e63a52d200534c16f2498d93e51c18cd9fc74be1cc52b9b99863c96bac" }, "downloads": -1, "filename": "coworker-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "47369ea40cea0bf9006315cadc7c782c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4445, "upload_time": "2018-06-06T05:55:28", "url": "https://files.pythonhosted.org/packages/81/a6/beb088ae555a0589d22bef510e177be48e154f8ffdfa148f5ff688825f77/coworker-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f3d71da2fdfefe410512a75e04b2008d", "sha256": "2cfa8c72022bd72e65dc520d354637270353d6090b4592f2ed30d3d901ebc2b5" }, "downloads": -1, "filename": "coworker-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f3d71da2fdfefe410512a75e04b2008d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13096, "upload_time": "2018-06-06T05:55:30", "url": "https://files.pythonhosted.org/packages/44/d8/6c8ffcaf2255d4648b6df87910487d251510ee73ee560cf1ca31d3e02797/coworker-1.0.1.tar.gz" } ] }