{ "info": { "author": "Ankit Kathuria", "author_email": "ankitkathuria534@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# Async Services\n\n[![Build Status](https://travis-ci.org/gekco/async_services.svg?branch=master)](https://travis-ci.org/gekco/async_services)\n\nRun fast asynchronous code from a synchronous code. Async Services provide a synchronous wrapper to run\nthird party asynchronous code or any coroutine for that matter in a synchronous way from a synchronous code.\n\n### Installation\n\n```\npip install async_services\n```\n\n## For Development Purposes\nInstall project Dependencies\n```\npip install -r requirements.txt\n```\n\n```\npip install -U .\n```\n\n## Running the tests\n\nYou can run the tests with the following command\n\n```\npytest .\n```\n\n### And coding style tests\n\n```\npycodestyle .\n```\n\n### Example Usage\n\n```\nfrom async_services.core import run_coro, run_manager, stop_manager\nfrom async_services.core.manager import CoroStatus\nimport asyncio\n\nasync def coroutine(seconds=1, raise_exception=False):\n await asyncio.sleep(seconds)\n if raise_exception:\n raise Exception(\"Sample Exception\")\n return \"Hello World\"\n\nrun_manager()\nresult = run_coro(coroutine(), block=True)\nprint(result)\nassert result[0] == CoroStatus.Completed\nassert result[1] == \"Hello World\"\nstop_manager()\n\n```\n## Output\nResult will be a tuple consisting of two values (status, result)\nstatus will be a integer between 0 and 5 and it defines the state of the coruotine\n\n```\n(1, 'Hello World')\n```\n\n## Coroutine Status\nPresently there are six status of a coruotine\n\n1. Queued = 0 -> Coroutine is still queued waiting to be executed or is being executed\n2. Completed = 1 -> Coroutine has Completed Successfully\n3. Failed = 2 -> Coroutine Completed Successfully , But callback function raised an exception\n4. Cancelled = 3 -> Coroutine was Cancelled\n5. Timeout = 4 -> Coroutine did not complete in the given time\n6. CoroutineException = 5 -> Coroutine Itself Raised an Exception\n\n## Authors\n\n* **Ankit Kathuria** - *Initial work*\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\n* Hat tip to anyone whose code was used\n* Inspiration\n* etc", "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/gekco/async_services", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "async-services", "package_url": "https://pypi.org/project/async-services/", "platform": "", "project_url": "https://pypi.org/project/async-services/", "project_urls": { "Homepage": "https://github.com/gekco/async_services" }, "release_url": "https://pypi.org/project/async-services/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Synchronus Wrapper for Async Code", "version": "1.0.2" }, "last_serial": 5304065, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5bbf1946925ffe7c68d276a07b89bba9", "sha256": "2130b7eb20e03d94434260f3a9da2c306fab24dc778c641529fa3cfa2940b4f1" }, "downloads": -1, "filename": "async_services-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5bbf1946925ffe7c68d276a07b89bba9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4714, "upload_time": "2019-05-20T20:09:35", "url": "https://files.pythonhosted.org/packages/6e/22/e65df4815bb2e5e0a58c75416687af34808aa584b86b122d6fd400503d2c/async_services-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "94748699bd5c043f2fb0859a9e2bfcb7", "sha256": "e4f4d13b53a84284a8a996ee6239553a0cb5229946ccedae5573c17620318002" }, "downloads": -1, "filename": "async_services-1.0.0.tar.gz", "has_sig": false, "md5_digest": "94748699bd5c043f2fb0859a9e2bfcb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3233, "upload_time": "2019-05-20T20:09:37", "url": "https://files.pythonhosted.org/packages/6f/cc/fbef23b2f8cfb35231996ba639ae6ae7adbc1854355b9033c79a43737f7f/async_services-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "00a26aa7aff27bf66a09dea6662557ea", "sha256": "32fc61f63d280b5270efe7aad78c7f33dd5a1db9942fbc5350c4ba756226831d" }, "downloads": -1, "filename": "async_services-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "00a26aa7aff27bf66a09dea6662557ea", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7597, "upload_time": "2019-05-21T20:45:59", "url": "https://files.pythonhosted.org/packages/f2/10/6ae0596d4e62ea67a8b3d10c398e1afe675c4704914b20fd61cc02f5662c/async_services-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "82ecfb8aa1fb4fe21172522d9a3a3f5f", "sha256": "d39963d082b62781137a789111cc48017524bd16d3d25271b511ff433c08f467" }, "downloads": -1, "filename": "async_services-1.0.1.tar.gz", "has_sig": false, "md5_digest": "82ecfb8aa1fb4fe21172522d9a3a3f5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5261, "upload_time": "2019-05-21T20:46:00", "url": "https://files.pythonhosted.org/packages/dd/d1/8fe4625dfe79e7a84c0e7bb9f5c8f62477e3812e38d974c56b6896e0055c/async_services-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "f9ed17895cfaaf25b10be10011e6e1b2", "sha256": "63e9aba894cc81365441fe739eca5654e36874a0585dbcba2a088c9a48e7e1ab" }, "downloads": -1, "filename": "async_services-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f9ed17895cfaaf25b10be10011e6e1b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5249, "upload_time": "2019-05-22T18:51:52", "url": "https://files.pythonhosted.org/packages/78/c8/1640d203fb77efede6c5ce0cee002b0c8214e80cc5722a2dcc3ef55b947d/async_services-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f9ed17895cfaaf25b10be10011e6e1b2", "sha256": "63e9aba894cc81365441fe739eca5654e36874a0585dbcba2a088c9a48e7e1ab" }, "downloads": -1, "filename": "async_services-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f9ed17895cfaaf25b10be10011e6e1b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5249, "upload_time": "2019-05-22T18:51:52", "url": "https://files.pythonhosted.org/packages/78/c8/1640d203fb77efede6c5ce0cee002b0c8214e80cc5722a2dcc3ef55b947d/async_services-1.0.2.tar.gz" } ] }