{ "info": { "author": "Dustin Spicuzza", "author_email": "dustin@virtualroadside.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "greenado\n========\n\n.. image:: https://travis-ci.org/virtuald/greenado.png?branch=master\n :target: https://travis-ci.org/virtuald/greenado\n :alt: Test status\n\n.. image:: https://coveralls.io/repos/virtuald/greenado/badge.png\n :target: https://coveralls.io/r/virtuald/greenado\n :alt: Test coverage status\n\n.. image:: https://readthedocs.org/projects/greenado/badge/?version=latest\n :target: https://readthedocs.org/projects/greenado/?badge=latest\n :alt: Documentation\n\nGreenado is a utility library that provides greenlet-based coroutines for\ntornado. In tornado, coroutines allow you to perform asynchronous operations\nwithout using callbacks, providing a pseudo-synchronous flow in your \nfunctions.\n\nWhen using Tornado's :func:`@gen.coroutine ` in a\nlarge codebase, you will notice that they tend to be 'infectious' from\nthe bottom up. In other words, for them to be truly useful, callers of\nthe coroutine should 'yield' to them, which requires them to be a\ncoroutine. In turn, their callers need to 'yield', and so on.\n\nInstead, greenado coroutines infect from the top down, and only requires\nthe :func:`@greenado.groutine ` decorator\n*somewhere* in the call hierarchy, but it doesn't really matter where.\nOnce the decorator is used, you can use :func:`greenado.gyield() `\nto pseudo-synchronously wait for asynchronous events to occur. This reduces\ncomplexity in large codebases, as you only need to use the decorator at\nthe very top of your call trees, and nowhere else.\n\nDocumentation\n=============\n\nDocumentation can be found at http://greenado.readthedocs.org/en/latest/\n\nInstallation & Requirements\n===========================\n\nInstallation is easiest using pip:\n\n.. code-block:: bash\n\n $ pip install greenado \n\ngreenado should work using tornado 3.2, but I only actively use it in\ntornado 4+\n\nI have only tested greenado on Linux & OSX, but I imagine that it would\nwork correctly on platforms that tornado and greenlet support.\n\nExample usage\n=============\n\nIn the below examples, 'main_function' is your toplevel function\nin the call hierarchy that needs to call things that eventually call\nsome asynchronous operation in tornado.\n\nNormal tornado coroutine usage might look something like this:\n\n.. code-block:: python\n\n from tornado import gen\n\n @gen.coroutine\n def do_long_operation():\n retval = yield long_operation()\n raise gen.Return(retval)\n\n @gen.coroutine\n def call_long_operation():\n retval = yield do_long_operation()\n raise gen.Return(retval)\n\n @gen.coroutine\n def main_function():\n retval = yield call_long_operation()\n\nWith greenado, it looks something like this instead:\n\n.. code-block:: python\n\n import greenado\n\n def do_long_operation():\n retval = greenado.gyield(long_operation())\n return retval\n\n def call_long_operation():\n retval = do_long_operation()\n return retval\n\n @greenado.groutine\n def main_function():\n retval = call_long_operation()\n\nFunctions wrapped by :func:`@greenado.groutine ` return a\n:class:`tornado.concurrent.Future` object which you must either yield, call\nresult(), or use :meth:`IOLoop.add_future ` on, otherwise you may risk\nswallowing exceptions.\n\nWhy can't I use the yield keyword?\n----------------------------------\n\nWell, actually, if you use yet another decorator, you still can! Check out\nthis example:\n\n.. code-block:: python\n\n import greenado\n\n\t@greenado.generator\n def do_long_operation():\n retval = yield long_operation()\n return retval\n\n def call_long_operation():\n retval = do_long_operation()\n return retval\n\n @greenado.groutine\n def main_function():\n retval = call_long_operation()\n\nYou'll note that this is very similar to the coroutines available from\ntornado (and in fact, the implementation is mostly the same), but the\ndifference is that (once again) you don't need to do anything special\nto call the do_long_operation function, other than make sure that\n:func:`@greenado.groutine ` is in the call stack somewhere.\n\n\nTesting\n=======\n\ngreenado.testing contains a function called gen_test which can be used \nexactly like :func:`tornado.testing.gen_test`:\n\n.. code-block:: python\n\n import greenado\n \n from greenado.testing import gen_test\n from tornado.testing import AsyncTestCase\n \n def something_that_yields():\n greenado.gyield(something())\n \n class MyTest(AsyncTestCase):\n @gen_test\n def test_something(self):\n something_that_yields()\n\n\nContributing new changes\n========================\n\n1. Fork this repository\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Test your changes (`tests/run_tests.sh`)\n4. Commit your changes (`git commit -am 'Add some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n\nCredit\n======\n\nGreenado is similar to and inspired by https://github.com/mopub/greenlet-tornado\nand https://github.com/Gawen/tornalet, but does not require that you use it from\na tornado web handler as they do.\n\nAuthors\n=======\n\nDustin Spicuzza (dustin@virtualroadside.com)\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/virtuald/greenado", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "greenado", "package_url": "https://pypi.org/project/greenado/", "platform": "", "project_url": "https://pypi.org/project/greenado/", "project_urls": { "Homepage": "https://github.com/virtuald/greenado" }, "release_url": "https://pypi.org/project/greenado/0.2.5/", "requires_dist": null, "requires_python": "", "summary": "Greenlet-based coroutines for tornado", "version": "0.2.5" }, "last_serial": 3646611, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c4b1018e05969db20c7a16558bb915de", "sha256": "2dcc1ae2f0d310f959e1f2bf90915fa531e215fd627ed01a861fbce3102e4260" }, "downloads": -1, "filename": "greenado-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c4b1018e05969db20c7a16558bb915de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4384, "upload_time": "2014-08-28T05:32:19", "url": "https://files.pythonhosted.org/packages/cd/65/d00e9f0679fe66e148bf82521077a602078dfdba2e64f4f18fa7800095d0/greenado-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "83f7301a4b09ab07c333b732c07926c7", "sha256": "5aedb265ff2826f9aac4c0b14994088a2aac860e91461ed0a084c651cd4997fc" }, "downloads": -1, "filename": "greenado-0.1.1.tar.gz", "has_sig": false, "md5_digest": "83f7301a4b09ab07c333b732c07926c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4421, "upload_time": "2014-08-28T05:46:07", "url": "https://files.pythonhosted.org/packages/4d/4c/e459556fc51a3e88bef2235cb9308ef16f7777da50edf2457ffebbc0eb89/greenado-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f9644966183e29ab48bcab8200d2cc54", "sha256": "07870a0aa942e83dfff53cd534c947efbd37893f8744a622e7e372335a0f1ab3" }, "downloads": -1, "filename": "greenado-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f9644966183e29ab48bcab8200d2cc54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4461, "upload_time": "2014-08-28T06:11:30", "url": "https://files.pythonhosted.org/packages/89/26/f6ba030550f444d34f2418f2e611115e1c71bf53768820ea033a33ef302a/greenado-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ac234842c123fd9f1f79b3733623dc25", "sha256": "877f510a3d36afe3a61ba0e7b7bca93b97c8a554496ccc41d2cff21b44499e74" }, "downloads": -1, "filename": "greenado-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ac234842c123fd9f1f79b3733623dc25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4677, "upload_time": "2014-08-28T15:11:16", "url": "https://files.pythonhosted.org/packages/b0/ae/2302a6930bb204fda15549631873b983b6da626c7dee3f18c77af0b03125/greenado-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "932167d00a1fa571eb635fa8563c5bae", "sha256": "e38e7d3f0b644e393cac0f63d5e10f75058ff52f9b776891073938ed20a1fd0b" }, "downloads": -1, "filename": "greenado-0.1.4.tar.gz", "has_sig": false, "md5_digest": "932167d00a1fa571eb635fa8563c5bae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5154, "upload_time": "2014-08-28T18:17:28", "url": "https://files.pythonhosted.org/packages/93/1b/a176a96512816c9b14e3353eec67a73a104fc683f890b97fa9abb4204507/greenado-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "b5f64130b80f5c7c73fb090c376e1477", "sha256": "87da90dc976ada6f2fba47f850e92ccd959bb03076671631f557080c43c40e70" }, "downloads": -1, "filename": "greenado-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b5f64130b80f5c7c73fb090c376e1477", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5679, "upload_time": "2014-08-28T20:10:29", "url": "https://files.pythonhosted.org/packages/80/a1/2888f13e313cf4b67d2e073baf9bfdc2289eea1def0f6f4305af187b71a4/greenado-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "01de233d2369d7098a8bee616acf2d7f", "sha256": "3500ea66d5b866976354b36ec058b1d112958d2c26e31caf490744234d359be2" }, "downloads": -1, "filename": "greenado-0.1.6.tar.gz", "has_sig": false, "md5_digest": "01de233d2369d7098a8bee616acf2d7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5893, "upload_time": "2014-09-04T22:21:39", "url": "https://files.pythonhosted.org/packages/32/12/3451f40b8a95c0789bf780bef116f1a194d4b0b8c264fdcd50e7d5793cc0/greenado-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "438cac958ec5e3c301514ed3c54cbc48", "sha256": "1405a0ec51ffd1e634c4189833a7a636064a4a223f3dbe68b368113522dc2d75" }, "downloads": -1, "filename": "greenado-0.1.7.tar.gz", "has_sig": false, "md5_digest": "438cac958ec5e3c301514ed3c54cbc48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7094, "upload_time": "2014-09-12T03:48:20", "url": "https://files.pythonhosted.org/packages/81/ea/e53b86892b5c2c303694c19a317818a662d22d68e48db787ce84dd9b2087/greenado-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "682bed168fb253c58d38265a5f0d4838", "sha256": "9e3d868fe417f733e0c198084ab83f3483a7bf6b52b60b07030678dcff6f2505" }, "downloads": -1, "filename": "greenado-0.1.8.tar.gz", "has_sig": false, "md5_digest": "682bed168fb253c58d38265a5f0d4838", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7533, "upload_time": "2014-10-23T13:41:21", "url": "https://files.pythonhosted.org/packages/b7/c6/fedf650c3f42171d91e883e9a1052c82d0578e2bf940bec5bc4d497eed2e/greenado-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "19e9ee40abb42418fef7b341cf915d66", "sha256": "9267613cb28c3a3d368b26bd9cd2948596aa96b1c42618105cb6968d09192843" }, "downloads": -1, "filename": "greenado-0.1.9.tar.gz", "has_sig": false, "md5_digest": "19e9ee40abb42418fef7b341cf915d66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7745, "upload_time": "2015-08-05T22:33:25", "url": "https://files.pythonhosted.org/packages/5e/d7/82fb18e4be61f25211e4d1d72742aafe56f1b7068451077545a2d73d464e/greenado-0.1.9.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2eba3beaf4a657b32e7d9c0724883441", "sha256": "5b786786273a65bd0bc4c62500a2972e9b4c16e3b910853b59a681ce696cca70" }, "downloads": -1, "filename": "greenado-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2eba3beaf4a657b32e7d9c0724883441", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8125, "upload_time": "2016-04-06T17:39:37", "url": "https://files.pythonhosted.org/packages/2e/12/696eabbcd3158914dd96a7b5ba4597c52df1dac155f0e274dfc114b886d4/greenado-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "7ea2f2e8e1faea7536452e5a7338571f", "sha256": "62438176f9f8dbd262547068c461a01987872c371dc15146e3cdde600345e8d1" }, "downloads": -1, "filename": "greenado-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7ea2f2e8e1faea7536452e5a7338571f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8355, "upload_time": "2016-04-19T23:01:24", "url": "https://files.pythonhosted.org/packages/7f/00/4d1c8cbcccc42cd593f6abd7d25056b0cd6ba956d4b3af8e6bffaba15083/greenado-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "36682f9924843e87d38ec29bd2552676", "sha256": "096a7299991cfb00a197f1a8f86f12bd9526d1c9222d28a65a19d5838652e0a7" }, "downloads": -1, "filename": "greenado-0.2.2.tar.gz", "has_sig": false, "md5_digest": "36682f9924843e87d38ec29bd2552676", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8545, "upload_time": "2016-04-20T19:25:39", "url": "https://files.pythonhosted.org/packages/d3/d6/052bafb996e4a62787c37cf5323ee0ebb6789f551737265d18a6f5cfcfc5/greenado-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5c8d7a15a2e62ea2483b0b5e54a5d1cd", "sha256": "0d0437818e8810713db50e240f008168e66ddb63b218ab0cf271a5c2be7e5f7c" }, "downloads": -1, "filename": "greenado-0.2.3.tar.gz", "has_sig": false, "md5_digest": "5c8d7a15a2e62ea2483b0b5e54a5d1cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8730, "upload_time": "2016-05-13T20:18:51", "url": "https://files.pythonhosted.org/packages/3a/c4/70ccc3eb91ae0a0a0840e7fc873d6775bdbc4b457beb1c230838124af768/greenado-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "51b666480da612dcf0afbfa508cf1e9d", "sha256": "d47108619f15784dba112ada59ca2b062cbff0b922cdfc136332567c95eef638" }, "downloads": -1, "filename": "greenado-0.2.4.tar.gz", "has_sig": false, "md5_digest": "51b666480da612dcf0afbfa508cf1e9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8780, "upload_time": "2016-06-06T22:59:56", "url": "https://files.pythonhosted.org/packages/59/13/879190a17b1d263c0c622ba438e67ac6290c0de993f2c07c45ba1471ca51/greenado-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "648aa7d9464ea8282e6717b3f7bfce8e", "sha256": "60803607275bbd8e77c558f6d82b3c347106ad0c570ec9931b8163ead935c3cb" }, "downloads": -1, "filename": "greenado-0.2.5.tar.gz", "has_sig": false, "md5_digest": "648aa7d9464ea8282e6717b3f7bfce8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8906, "upload_time": "2018-03-07T05:25:58", "url": "https://files.pythonhosted.org/packages/8b/ad/6336c74763c963e24fd6d5ffa1e3c9c17af730506026bdfbcf0987e81a4c/greenado-0.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "648aa7d9464ea8282e6717b3f7bfce8e", "sha256": "60803607275bbd8e77c558f6d82b3c347106ad0c570ec9931b8163ead935c3cb" }, "downloads": -1, "filename": "greenado-0.2.5.tar.gz", "has_sig": false, "md5_digest": "648aa7d9464ea8282e6717b3f7bfce8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8906, "upload_time": "2018-03-07T05:25:58", "url": "https://files.pythonhosted.org/packages/8b/ad/6336c74763c963e24fd6d5ffa1e3c9c17af730506026bdfbcf0987e81a4c/greenado-0.2.5.tar.gz" } ] }