index.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. Eventlet Documentation
  2. ====================================
  3. Code talks! This is a simple web crawler that fetches a bunch of urls concurrently:
  4. .. code-block:: python
  5. urls = [
  6. "http://www.google.com/intl/en_ALL/images/logo.gif",
  7. "http://python.org/images/python-logo.gif",
  8. "http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif",
  9. ]
  10. import eventlet
  11. from eventlet.green.urllib.request import urlopen
  12. def fetch(url):
  13. return urlopen(url).read()
  14. pool = eventlet.GreenPool()
  15. for body in pool.imap(fetch, urls):
  16. print("got body", len(body))
  17. Supported Python versions
  18. =========================
  19. Currently CPython 2.7 and 3.4+ are supported, but **2.7 and 3.4 support is deprecated and will be removed in the future**, only CPython 3.5+ support will remain.
  20. Contents
  21. =========
  22. .. toctree::
  23. :maxdepth: 2
  24. basic_usage
  25. design_patterns
  26. patching
  27. examples
  28. ssl
  29. threading
  30. zeromq
  31. hubs
  32. testing
  33. environment
  34. modules
  35. authors
  36. history
  37. License
  38. ---------
  39. Eventlet is made available under the terms of the open source `MIT license <http://www.opensource.org/licenses/mit-license.php>`_
  40. Indices and tables
  41. ==================
  42. * :ref:`genindex`
  43. * :ref:`modindex`
  44. * :ref:`search`