{ "info": { "author": "Daniele Varrazzo", "author_email": "daniele.varrazzo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Database" ], "description": "psycogreen -- psycopg2 integration with coroutine libraries\n===========================================================\n\nThe `psycogreen`_ package enables psycopg2 to work with coroutine libraries,\nusing asynchronous calls internally but offering a blocking interface so that\nregular code can run unmodified.\n\n`Psycopg`_ offers `coroutines support`__ since release 2.2. Because the main\nmodule is a C extension it cannot be monkey-patched to become\ncoroutine-friendly. Instead it exposes `a hook`__ that coroutine libraries can\nuse to install a function integrating with their event scheduler. Psycopg will\ncall the function whenever it executes a libpq call that may block.\n`psycogreen` is a collection of \"wait callbacks\" useful to integrate Psycopg\nwith different coroutine libraries.\n\n.. _psycogreen: https://bitbucket.org/dvarrazzo/psycogreen\n.. _Psycopg: http://initd.org/psycopg/\n.. __: http://initd.org/psycopg/docs/advanced.html#support-to-coroutine-libraries\n.. __: http://initd.org/psycopg/docs/extensions.html#psycopg2.extensions.set_wait_callback\n\n\nModule ``psycogreen.eventlet``\n------------------------------\n\n`Eventlet`_ currently supports Psycopg out-of-the-box and ``psycogreen`` is not\nnecessary. See `the documentation`__ for patching instruction.\n\n.. _Eventlet: http://eventlet.net/\n.. __: http://eventlet.net/doc/patching.html#monkeypatching-the-standard-library\n\nIf for any reason you want to avoid using Eventlet monkeypatching you can use\n``psycogreen.eventlet.patch_psycopg()``.\n\nFunction ``psycogreen.eventlet.patch_psycopg()``\n Enable async processing in Psycopg integrated with the Eventlet events\n loop. It is performed by registering ``eventlet_wait_callback()`` as\n psycopg2 wait callback.\n\nFunction ``psycogreen.eventlet.eventlet_wait_callback(conn)``\n A wait callback integrating with Eventlet events loop.\n\nAn example script showing concurrent usage of ``psycopg2`` with ``urlopen()``\nwith Eventlet is available in |tests/test_eventlet.py|__.\n\n.. |tests/test_eventlet.py| replace:: ``tests/test_eventlet.py``\n.. __: https://bitbucket.org/dvarrazzo/psycogreen/src/master/tests/test_eventlet.py\n\n\nModule ``psycogreen.gevent``\n----------------------------\n\nIn order to use psycopg2 asynchronously with `gevent`_ you can use\n``psycogreen.gevent.patch_psycopg()``.\n\nFunction ``psycogreen.gevent.patch_psycopg()``\n Enable async processing in Psycopg integrated with the gevent events\n loop. It is performed by registering ``gevent_wait_callback()`` as\n psycopg2 wait callback.\n\nFunction ``psycogreen.gevent.gevent_wait_callback(conn)``\n A wait callback integrating with gevent events loop.\n\nAn example script showing concurrent usage of ``psycopg2`` with ``urlopen()``\nwith gevent is available in |tests/test_gevent.py|__.\n\n.. _gevent: http://www.gevent.org/\n.. |tests/test_gevent.py| replace:: ``tests/test_gevent.py``\n.. __: https://bitbucket.org/dvarrazzo/psycogreen/src/master/tests/test_gevent.py\n\n\nuWSGI green threads\n-------------------\n\nRoberto De Ioris is writing uGreen__, a green thread implementation on top of\nthe `uWSGI async platform`__.\n\n.. __: http://projects.unbit.it/uwsgi/wiki/uGreen\n.. __: http://projects.unbit.it/uwsgi/\n\nHe has performed some tests using both `psycopg2 async support`__ and\n`psycopg2 green support`__ and has reported no problem in their stress tests\nwith both the async styles.\n\n.. __: http://projects.unbit.it/uwsgi/browser/tests/psycopg2_green.py\n.. __: http://projects.unbit.it/uwsgi/browser/tests/psycogreen_green.py", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/dvarrazzo/psycogreen", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "psycogreen", "package_url": "https://pypi.org/project/psycogreen/", "platform": "", "project_url": "https://pypi.org/project/psycogreen/", "project_urls": { "Homepage": "https://bitbucket.org/dvarrazzo/psycogreen" }, "release_url": "https://pypi.org/project/psycogreen/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "psycopg2 integration with coroutine libraries", "version": "1.0.1" }, "last_serial": 4618703, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0cf9ddff132525cc5646f43415609373", "sha256": "484e387c61607627caceaedb3804490eca9f3d48ad72ca5a13268185eeb1c9b4" }, "downloads": -1, "filename": "psycogreen-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0cf9ddff132525cc5646f43415609373", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2919, "upload_time": "2011-12-02T00:39:18", "url": "https://files.pythonhosted.org/packages/c3/6f/c56c584ccf340fe43a604f64552315520abf1dce9bb57300e654af2c8cb4/psycogreen-0.0.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "7a32d8f5abdb4ce17ac512f8c8a698a9", "sha256": "9acfa6cb5373bcf1eaf27c904d98d59c9f3bb0065cbb005f83ccc45055ace9a1" }, "downloads": -1, "filename": "psycogreen-1.0.tar.gz", "has_sig": false, "md5_digest": "7a32d8f5abdb4ce17ac512f8c8a698a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5052, "upload_time": "2012-10-10T23:28:07", "url": "https://files.pythonhosted.org/packages/66/29/9250c6a11822f56a1c2f703e4031d173c5b3725095d3422c11cafcc5427f/psycogreen-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "f03c60bf9b788e066db63680e6e19c0b", "sha256": "86fe2a066d99526b3cff74ca45fd265b5b412a570195488603e298266e91be17" }, "downloads": -1, "filename": "psycogreen-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f03c60bf9b788e066db63680e6e19c0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5181, "upload_time": "2018-12-19T23:28:29", "url": "https://files.pythonhosted.org/packages/c4/bf/b8f1a11326c8ad6b2c4dae2ae5026e014c348d54f2d9c782a259ab49b48b/psycogreen-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f03c60bf9b788e066db63680e6e19c0b", "sha256": "86fe2a066d99526b3cff74ca45fd265b5b412a570195488603e298266e91be17" }, "downloads": -1, "filename": "psycogreen-1.0.1.tar.gz", "has_sig": false, "md5_digest": "f03c60bf9b788e066db63680e6e19c0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5181, "upload_time": "2018-12-19T23:28:29", "url": "https://files.pythonhosted.org/packages/c4/bf/b8f1a11326c8ad6b2c4dae2ae5026e014c348d54f2d9c782a259ab49b48b/psycogreen-1.0.1.tar.gz" } ] }