{ "info": { "author": "James Arnold", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# flexes-lib\n\n[![Build Status](https://travis-ci.org/lanl-ansi/flexes-lib.svg?branch=master)](https://travis-ci.org/lanl-ansi/flexes-lib)\n[![codecov](https://codecov.io/gh/lanl-ansi/flexes-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/lanl-ansi/flexes-lib)\n\nClient library for flexes\n\n### Dependencies\nFor asynchronous task execution Python >= 3.5 is required.\n\n### Usage at a glance\nTo run a task through the API synchronously\n```python\nfrom flexes_lib.job import run_task\n\nmessage = {'service': 'echo-test', 'test': True}\nresult = run_task(message)\nprint(result['status'])\n# active\n```\n\nAsynchronous tasks are also supported\n```python\nfrom asyncio import get_event_loop\nfrom flexes_lib.async_job import run_task\n\nmessage = {'service': 'echo-test', 'test': True}\nresult = loop.run_until_complete(run_task(message))\nprint(result['status'])\n# active\n```\n\nThe nice thing about asynchronous tasks is that you can run them in parallel.\nThis example submits three jobs in parallel and then waits for all three to\ncomplete before returning the results.\n```python\nfrom asyncio import gather, get_event_loop\nfrom flexes_lib.async_job import run_task\n\nm1 = {'service': 'echo-test', 'test': True}\nm2 = {'service': 'echo-test', 'test': True}\nm3 = {'service': 'echo-test', 'test': True}\nresults = loop.run_until_complete(\n gather(\n run_task(m1),\n run_task(m2),\n run_task(m3)\n )\n)\nprint([result['status'] for result in results])\n# ['active', 'active', 'active']\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "flexes-lib", "package_url": "https://pypi.org/project/flexes-lib/", "platform": "", "project_url": "https://pypi.org/project/flexes-lib/", "project_urls": null, "release_url": "https://pypi.org/project/flexes-lib/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Helper library for interacting with flexes", "version": "0.1.1" }, "last_serial": 4969377, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "ca56e6333a7c9c3b56ff7c38ab962453", "sha256": "b82141073de506701fd1805a93414c951d8f6a0a558967c67c889a48a14ec151" }, "downloads": -1, "filename": "flexes_lib-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ca56e6333a7c9c3b56ff7c38ab962453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7056, "upload_time": "2019-03-21T18:19:31", "url": "https://files.pythonhosted.org/packages/eb/aa/faa822430649166d2a6c69a555ef4a94af35f40b3a5f584bad90a5ad8b1f/flexes_lib-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca56e6333a7c9c3b56ff7c38ab962453", "sha256": "b82141073de506701fd1805a93414c951d8f6a0a558967c67c889a48a14ec151" }, "downloads": -1, "filename": "flexes_lib-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ca56e6333a7c9c3b56ff7c38ab962453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7056, "upload_time": "2019-03-21T18:19:31", "url": "https://files.pythonhosted.org/packages/eb/aa/faa822430649166d2a6c69a555ef4a94af35f40b3a5f584bad90a5ad8b1f/flexes_lib-0.1.1.tar.gz" } ] }