{ "info": { "author": "Landreville", "author_email": "landreville@heyneat.ca", "bugtrack_url": null, "classifiers": [ "Framework :: Pyramid", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP" ], "description": "Run an asyncio loop in it's own thread for scheduling awaitables from\nwithin Pyramid views.\n\nThis adds request property `loop` and request methods `wait_for`,\n`wait_results`, and `await`.\n\nThe `loop` property returns the loop running\nin it's own thread. Use this loop with `asyncio.run_coroutine_threadsafe`\nto run awaitables. For example:\n\n```python\n import asyncio\n from concurrent import futures\n\n def my_view(request):\n running = asyncio.run_coroutine_threadsafe(my_coroutine(), request.loop)\n done, not_done = futures.wait([running, ...], timeout=3)\n results = [ftr.result() for ftr in done]\n return {'done': results}\n```\n\nThe `wait_for` method reduces the above boiler plate by waiting for the\nfutures. Example usage\n```python\n def my_view(request):\n done, not_done = request.wait_for([my_coroutine(), ...])\n results = [ftr.result() for ftr in done]\n return {'done': results}\n```\n\nThe `wait_results` method reduces the boiler plate further by returning\nthe results after waiting. This is useful if you don't care about\nunfinished tasks. Example usage:\n\n```python\n def my_view(request):\n results = request.wait_results([my_coroutine(), ...])\n return {'done': results}\n```\n\nThe `await` method runs a single awaitable and\nblocks until it's results are complete or timeout passes.\nExample usage:\n\n```python\n from frond import AwaitableTimeout\n\n def my_view(request):\n try:\n result = request.await(my_coroutine(), timeout=3)\n except AwaitableTimeout:\n result = 'not completed'\n return {'result': result}\n```\n\nUse as any other Pyramid plugin:\n\n```python\n config.include('frond')\n```\n\nCurrently this package only supports Python 3 (and only tested on Python >=3.6).\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://gitlab.com/landreville/frond", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "frond", "package_url": "https://pypi.org/project/frond/", "platform": "", "project_url": "https://pypi.org/project/frond/", "project_urls": { "Homepage": "https://gitlab.com/landreville/frond" }, "release_url": "https://pypi.org/project/frond/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Asynchronous Fan Out/In for Pyramid.", "version": "0.0.4" }, "last_serial": 3979097, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "9835bf34393b2a8bf22f85598f2debe6", "sha256": "368e8472cd42e107d391ecfee47a3212846b03ae867cc9d44d710dc190a3d03c" }, "downloads": -1, "filename": "frond-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "9835bf34393b2a8bf22f85598f2debe6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3437, "upload_time": "2018-06-19T21:04:29", "url": "https://files.pythonhosted.org/packages/aa/0d/b237618db1c73066add6e70d9264f4c9df3135a203c5d287ad5a5d965912/frond-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ad297123e1eef25d26425fbd717f523d", "sha256": "3ac5940d602be0b0f8503ee7d1aced833e860004d71f16ebb1f380a2b4d383e1" }, "downloads": -1, "filename": "frond-0.0.3.tar.gz", "has_sig": false, "md5_digest": "ad297123e1eef25d26425fbd717f523d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2896, "upload_time": "2018-06-19T21:04:29", "url": "https://files.pythonhosted.org/packages/00/6d/45b90233c49b936f2e2f161503b4e3a5fb38b8061cf9d87dfe71900e4571/frond-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "7d25c171f3d9edb622032107a16162c1", "sha256": "532c573323db9d2960cc175d7e1a9406d29877623f1eff4eb2b5f36f6f532b73" }, "downloads": -1, "filename": "frond-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "7d25c171f3d9edb622032107a16162c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3440, "upload_time": "2018-06-19T21:05:38", "url": "https://files.pythonhosted.org/packages/26/73/8ade4da3f9d937195fe886ec4908b9f7c0f30981e705dd401b427e0a75c4/frond-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d2f9d23d9549774cc3496de271c6514", "sha256": "6fa29333f6b4c3f0328909ed61b2865de195267bfbbcd21edc800318be07c2ad" }, "downloads": -1, "filename": "frond-0.0.4.tar.gz", "has_sig": false, "md5_digest": "1d2f9d23d9549774cc3496de271c6514", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2905, "upload_time": "2018-06-19T21:05:38", "url": "https://files.pythonhosted.org/packages/f2/c8/47ac7ef27af8b74e8e0b26645458bd6b6d8c094f3709c86b61e0d55be131/frond-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7d25c171f3d9edb622032107a16162c1", "sha256": "532c573323db9d2960cc175d7e1a9406d29877623f1eff4eb2b5f36f6f532b73" }, "downloads": -1, "filename": "frond-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "7d25c171f3d9edb622032107a16162c1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3440, "upload_time": "2018-06-19T21:05:38", "url": "https://files.pythonhosted.org/packages/26/73/8ade4da3f9d937195fe886ec4908b9f7c0f30981e705dd401b427e0a75c4/frond-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d2f9d23d9549774cc3496de271c6514", "sha256": "6fa29333f6b4c3f0328909ed61b2865de195267bfbbcd21edc800318be07c2ad" }, "downloads": -1, "filename": "frond-0.0.4.tar.gz", "has_sig": false, "md5_digest": "1d2f9d23d9549774cc3496de271c6514", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2905, "upload_time": "2018-06-19T21:05:38", "url": "https://files.pythonhosted.org/packages/f2/c8/47ac7ef27af8b74e8e0b26645458bd6b6d8c094f3709c86b61e0d55be131/frond-0.0.4.tar.gz" } ] }