{ "info": { "author": "cdlr75", "author_email": "cdlr75@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "aio-task\n[![pipeline status](https://gitlab.com/cdlr75/aio-task/badges/master/pipeline.svg)](https://gitlab.com/cdlr75/aio-task/commits/master)\n[![coverage report](https://gitlab.com/cdlr75/aio-task/badges/master/coverage.svg)](https://gitlab.com/cdlr75/aio-task/commits/master)\n[![PEP8](https://img.shields.io/badge/code%20style-pep8-green.svg)](https://www.python.org/dev/peps/pep-0008/)\n===\n\nReliable and perfoment asynchronous tasks manager that is asyncio friendly.\n\n## Key Features\n\n- A simple worker interface to register coroutines as tasks.\n- A simple broker interface to produce and fetch tasks.\n- Broker and worker(s) can be setup in a single program avoiding external service dependencies (by using dummies queue and cache).\n- Task is not lost if worker crash during processing it, it's keep in queue and re-processed until a worker ack.\n- Task exceptions are not lost: you will retreiv them in the task's result.\n- Works out of the box with rabbitmq and redis.\n- Easily hackable to add new queuing/caching services\n\n## Getting Started\n\n*Use `examples/docker-compose.yml` to bring up a rabbitmq and a redis to run this example.*\n\nWorker \u2192 run tasks\n```python\nimport asyncio\nfrom aio_task import Worker\n\nasync def addition(a, b):\n \"\"\" Task example. \"\"\"\n return a + b\n\nasync def start_worker():\n rabbitmq_config = {\"url\": \"amqp://guest:guest@localhost:5672\",\n \"routing_key\": \"tasks_queue\"}\n redis_config = {\"address\": \"redis://localhost\"}\n worker = await Worker.create(\"rabbitmq\", rabbitmq_config,\n \"redis\", redis_config)\n worker.register_handler(addition)\n await worker.start()\n return worker\n\nloop = asyncio.get_event_loop()\nworker = loop.run_until_complete(start_worker())\n\ntry:\n loop.run_forever()\nexcept KeyboardInterrupt:\n loop.run_until_complete(worker.close()) # gracefull shutdown\n\nloop.close()\n```\n\nBroker \u2192 produce tasks\n```python\nimport asyncio\nfrom aio_task import Broker\n\nasync def sample_addition():\n # setup broker\n rabbitmq_config = {\"url\": \"amqp://guest:guest@localhost:5672\",\n \"routing_key\": \"tasks_queue\"}\n redis_config = {\"address\": \"redis://localhost\"}\n return await Broker.create(\"rabbitmq\", rabbitmq_config,\n \"redis\", redis_config)\n # produce task\n task_id = await broker.create_task(\"addition\", {\"a\": 1, \"b\": 2})\n await asyncio.sleep(0.1)\n # fetch task\n task = await broker.get_task(task_id)\n print(task)\n await broker.close() # gracefull shutdown\n\nloop = asyncio.get_event_loop()\nloop.run_until_complete(sample_addition())\nloop.run_until_complete(broker.close())\n```\n\n*More examples in examples/...*\n\n\n## Run tests\n\n**unit tests**\n```\npip install -e .[test]\npytest -xvs tests/unit\n```\n\n**integration tests**\n```\npip install -e .[test]\ndocker-compose -f tests/integration/compose/docker-compose up -d\npytest -xvs tests/integration\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://cdlr75.gitlab.io/aio-task/", "keywords": "asyncio asynchronous tasks broker celery", "license": "", "maintainer": "", "maintainer_email": "", "name": "aio-task", "package_url": "https://pypi.org/project/aio-task/", "platform": "", "project_url": "https://pypi.org/project/aio-task/", "project_urls": { "Bug Reports": "https://gitlab.com/cdlr75/aio-task/issues", "Homepage": "https://cdlr75.gitlab.io/aio-task/", "Source": "https://gitlab.com/cdlr75/aio-task/" }, "release_url": "https://pypi.org/project/aio-task/1.0.2/", "requires_dist": [ "aioredis (==1.3.0)", "aio-pika (==6.1.2)", "sphinx ; extra == 'doc'", "recommonmark ; extra == 'doc'", "asynctest ; extra == 'test'", "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": ">=3.6", "summary": "A simple and reliable tasks manager. Attempt for a celery like, asyncio friendly.", "version": "1.0.2" }, "last_serial": 5973284, "releases": { "0.0.0.1": [ { "comment_text": "", "digests": { "md5": "e990f0b19d8d06abb78e82bc0de44ef7", "sha256": "26798b2369a53ec18cb8d46528e666489c0c53938995b6580d404a3e7ac943c8" }, "downloads": -1, "filename": "aio_task-0.0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e990f0b19d8d06abb78e82bc0de44ef7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27167, "upload_time": "2019-10-14T17:02:48", "url": "https://files.pythonhosted.org/packages/42/15/f1267b3e9ecc1c881589b0b44a58cb4257a67edc75eef8ab36272bd8c91a/aio_task-0.0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0beeb2052688fed26db397586382207", "sha256": "e1c5df02f40277965627d6a003ebd982cb0c7dd9d2419d26256889a42f20462d" }, "downloads": -1, "filename": "aio-task-0.0.0.1.tar.gz", "has_sig": false, "md5_digest": "d0beeb2052688fed26db397586382207", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 19477, "upload_time": "2019-10-14T17:02:51", "url": "https://files.pythonhosted.org/packages/da/aa/99745520179b36227f12aa6acfebe508847a50677f1a83c384526cf8675d/aio-task-0.0.0.1.tar.gz" } ], "1.0.0.2": [ { "comment_text": "", "digests": { "md5": "8ae94e263689ff15daf7cb8d73fd1380", "sha256": "d78a5c249e013c08f777cd064b9c5b008e5aaa85261ce57c0b8c16c798a58108" }, "downloads": -1, "filename": "aio_task-1.0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "8ae94e263689ff15daf7cb8d73fd1380", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27291, "upload_time": "2019-10-14T17:54:37", "url": "https://files.pythonhosted.org/packages/d8/65/396bc2e7fce7ed6227cec727cb3621451ec35f0d0b8d235a893c1a71555c/aio_task-1.0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f425cb2db1f6d63a6bebb76fdce5c9e2", "sha256": "b49ef77e6ae200c10bebe156139201e16bc14ac20efe0ccca0dcbf3b57f864b0" }, "downloads": -1, "filename": "aio-task-1.0.0.2.tar.gz", "has_sig": false, "md5_digest": "f425cb2db1f6d63a6bebb76fdce5c9e2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 18334, "upload_time": "2019-10-14T17:54:39", "url": "https://files.pythonhosted.org/packages/74/50/ad2b111a0c0aebfb406331a92f6555b06a185b1a583f608068118fc49800/aio-task-1.0.0.2.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "ffcc4850596af14ea0b657ca2f29b94b", "sha256": "6579247fca1fe10d6b3f8f41e3292eb52cb1116febf5bb6e6ef7a07712a2b7bb" }, "downloads": -1, "filename": "aio_task-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ffcc4850596af14ea0b657ca2f29b94b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27266, "upload_time": "2019-10-14T18:16:38", "url": "https://files.pythonhosted.org/packages/e6/83/e1ad1ac79100764b1e9b58a2c3fe04743bb1a6965cebfb745c514afacef1/aio_task-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "507fcc460a5df9cd29d36cbbb351d184", "sha256": "fe3c68ea0c8f0c29998dc4ba73092d0dd531fe9365266802659058fa9203800a" }, "downloads": -1, "filename": "aio-task-1.0.1.tar.gz", "has_sig": false, "md5_digest": "507fcc460a5df9cd29d36cbbb351d184", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 19496, "upload_time": "2019-10-14T18:16:40", "url": "https://files.pythonhosted.org/packages/3a/de/4b6f5d71926a56dbe4e3f9f07a18240742643fbfaf91f46b75e9c8083205/aio-task-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "69e7edf1dc0b1e7a4c7cfad1707ae2e7", "sha256": "0f44258652b8d38c91f19e6a7cf09a3db477dd6ca99535ae1a9d790352d616fb" }, "downloads": -1, "filename": "aio_task-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "69e7edf1dc0b1e7a4c7cfad1707ae2e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27525, "upload_time": "2019-10-14T20:11:54", "url": "https://files.pythonhosted.org/packages/77/7c/519c208b9febe83bae21a997d807881d428d8c690cbb949512814c34c0af/aio_task-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e6c501dc532c4c1c3e54921e2bdf4329", "sha256": "8ba46818398d69b07bc5b65309a6c549ba17593ad6fbf25ae6267ef315553302" }, "downloads": -1, "filename": "aio-task-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e6c501dc532c4c1c3e54921e2bdf4329", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 19662, "upload_time": "2019-10-14T20:11:55", "url": "https://files.pythonhosted.org/packages/78/cf/67775267800d9f43d7c09f3353674ec13486d455583d50a5422891b6e917/aio-task-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "69e7edf1dc0b1e7a4c7cfad1707ae2e7", "sha256": "0f44258652b8d38c91f19e6a7cf09a3db477dd6ca99535ae1a9d790352d616fb" }, "downloads": -1, "filename": "aio_task-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "69e7edf1dc0b1e7a4c7cfad1707ae2e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 27525, "upload_time": "2019-10-14T20:11:54", "url": "https://files.pythonhosted.org/packages/77/7c/519c208b9febe83bae21a997d807881d428d8c690cbb949512814c34c0af/aio_task-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e6c501dc532c4c1c3e54921e2bdf4329", "sha256": "8ba46818398d69b07bc5b65309a6c549ba17593ad6fbf25ae6267ef315553302" }, "downloads": -1, "filename": "aio-task-1.0.2.tar.gz", "has_sig": false, "md5_digest": "e6c501dc532c4c1c3e54921e2bdf4329", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 19662, "upload_time": "2019-10-14T20:11:55", "url": "https://files.pythonhosted.org/packages/78/cf/67775267800d9f43d7c09f3353674ec13486d455583d50a5422891b6e917/aio-task-1.0.2.tar.gz" } ] }