]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Document how to use IMAPClient with gevent
authorMenno Smits <menno@freshfoo.com>
Tue, 1 Sep 2015 05:01:23 +0000 (17:01 +1200)
committerMenno Smits <menno@freshfoo.com>
Tue, 1 Sep 2015 05:01:23 +0000 (17:01 +1200)
Closes #168.

doc/src/index.rst

index cc5efc6ba01769ed09c3a2286f8a0d2ec9ce1ff8..c68723ca17dcaab6e1bfe7c4daa930732ce4581a 100644 (file)
@@ -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
 -------------