index.rst 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 import urllib2
  12. def fetch(url):
  13. return urllib2.urlopen(url).read()
  14. pool = eventlet.GreenPool()
  15. for body in pool.imap(fetch, urls):
  16. print("got body", len(body))
  17. Contents
  18. =========
  19. .. toctree::
  20. :maxdepth: 2
  21. basic_usage
  22. design_patterns
  23. patching
  24. examples
  25. ssl
  26. threading
  27. zeromq
  28. hubs
  29. testing
  30. environment
  31. modules
  32. authors
  33. history
  34. License
  35. ---------
  36. Eventlet is made available under the terms of the open source `MIT license <http://www.opensource.org/licenses/mit-license.php>`_
  37. Indices and tables
  38. ==================
  39. * :ref:`genindex`
  40. * :ref:`modindex`
  41. * :ref:`search`