Add python-eventlet 0.16.1
[packages/trusty/python-eventlet.git] / eventlet / README.rst
1 Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it.
2
3 It uses epoll or libevent for highly scalable non-blocking I/O.  Coroutines ensure that the developer uses a blocking style of programming that is similar to threading, but provide the benefits of non-blocking I/O.  The event dispatch is implicit, which means you can easily use Eventlet from the Python interpreter, or as a small part of a larger application.
4
5 It's easy to get started using Eventlet, and easy to convert existing
6 applications to use it.  Start off by looking at the `examples`_,
7 `common design patterns`_, and the list of `basic API primitives`_.
8
9 .. _examples: http://eventlet.net/doc/examples.html
10 .. _common design patterns: http://eventlet.net/doc/design_patterns.html
11 .. _basic API primitives: http://eventlet.net/doc/basic_usage.html
12
13
14 Quick Example
15 ===============
16
17 Here's something you can try right on the command line::
18
19     % python
20     >>> import eventlet
21     >>> from eventlet.green import urllib2
22     >>> gt = eventlet.spawn(urllib2.urlopen, 'http://eventlet.net')
23     >>> gt2 = eventlet.spawn(urllib2.urlopen, 'http://secondlife.com')
24     >>> gt2.wait()
25     >>> gt.wait()
26
27
28 Getting Eventlet
29 ==================
30
31 The easiest way to get Eventlet is to use pip::
32
33   pip install eventlet
34
35 The development `tip`_ is available as well::
36
37   pip install 'eventlet==dev'
38
39 .. _tip: http://bitbucket.org/eventlet/eventlet/get/tip.zip#egg=eventlet-dev
40
41
42 Building the Docs Locally
43 =========================
44
45 To build a complete set of HTML documentation, you must have Sphinx, which can be found at http://sphinx.pocoo.org/ (or installed with `pip install Sphinx`)::
46
47   cd doc
48   make html
49
50 The built html files can be found in doc/_build/html afterward.
51
52
53 Twisted
54 =======
55
56 Eventlet had Twisted hub in the past, but community interest to this integration has dropped over time,
57 now it is not supported, so with apologies for any inconvenience we discontinue Twisted integration.
58
59 If you have a project that uses Eventlet with Twisted, your options are:
60
61 * use last working release eventlet==0.14
62 * start a new project with only Twisted hub code, identify and fix problems. As of eventlet 0.13,
63 `EVENTLET_HUB` environment variable can point to external modules.
64 * fork Eventlet, revert Twisted removal, identify and fix problems. This work may be merged back into main project.