index.rst 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Eventlet Documentation
  2. ====================================
  3. Code talks! This is a simple web crawler that fetches a bunch of urls concurrently::
  4. urls = ["http://www.google.com/intl/en_ALL/images/logo.gif",
  5. "https://wiki.secondlife.com/w/images/secondlife.jpg",
  6. "http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif"]
  7. import eventlet
  8. from eventlet.green import urllib2
  9. def fetch(url):
  10. return urllib2.urlopen(url).read()
  11. pool = eventlet.GreenPool()
  12. for body in pool.imap(fetch, urls):
  13. print "got body", len(body)
  14. Contents
  15. =========
  16. .. toctree::
  17. :maxdepth: 2
  18. basic_usage
  19. design_patterns
  20. patching
  21. examples
  22. ssl
  23. threading
  24. zeromq
  25. hubs
  26. testing
  27. environment
  28. modules
  29. authors
  30. history
  31. License
  32. ---------
  33. Eventlet is made available under the terms of the open source `MIT license <http://www.opensource.org/licenses/mit-license.php>`_
  34. Indices and tables
  35. ==================
  36. * :ref:`genindex`
  37. * :ref:`modindex`
  38. * :ref:`search`