From e80f9c9290ed1314546527598e468f4533b7c491 Mon Sep 17 00:00:00 2001 From: Menno Smits Date: Tue, 1 Sep 2015 17:01:23 +1200 Subject: [PATCH] Document how to use IMAPClient with gevent Closes #168. --- doc/src/index.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/src/index.rst b/doc/src/index.rst index cc5efc6..c68723c 100644 --- a/doc/src/index.rst +++ b/doc/src/index.rst @@ -186,6 +186,24 @@ The above examples show some of the most common TLS parameter customisations but there are many other tweaks are possible. Consult the Python 3 :py:mod:`ssl` package documentation for further options. +Using gevent with IMAPClient +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Some extra monkey patching is required to let gevent_ work with +pyOpenSSL (used by IMAPClient for TLS support). The `gevent_openssl`_ +package performs this patching and can be used with IMAPClient like +this:: + + from gevent import monkey; monkey.patch_all() + import gevent_openssl; gevent_openssl.monkey_patch() + + import imapclient + + client = imapclient.IMAPClient(...) + ... + +.. _gevent: http://www.gevent.org/ +.. _`gevent_openssl`: https://pypi.python.org/pypi/gevent_openssl/ + API Reference ------------- -- 2.43.0