Tune documentation
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
Eventlet Documentation
|
||||
====================================
|
||||
|
||||
Code talks! This is a simple web crawler that fetches a bunch of urls concurrently::
|
||||
Code talks! This is a simple web crawler that fetches a bunch of urls concurrently:
|
||||
|
||||
urls = ["http://www.google.com/intl/en_ALL/images/logo.gif",
|
||||
"https://wiki.secondlife.com/w/images/secondlife.jpg",
|
||||
"http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif"]
|
||||
.. code-block:: python
|
||||
|
||||
urls = [
|
||||
"http://www.google.com/intl/en_ALL/images/logo.gif",
|
||||
"https://wiki.secondlife.com/w/images/secondlife.jpg",
|
||||
"http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif",
|
||||
]
|
||||
|
||||
import eventlet
|
||||
from eventlet.green import urllib2
|
||||
|
||||
def fetch(url):
|
||||
return urllib2.urlopen(url).read()
|
||||
return urllib2.urlopen(url).read()
|
||||
|
||||
pool = eventlet.GreenPool()
|
||||
for body in pool.imap(fetch, urls):
|
||||
print("got body", len(body))
|
||||
print("got body", len(body))
|
||||
|
||||
Contents
|
||||
=========
|
||||
|
||||
@@ -136,7 +136,7 @@ for body in pool.imap(fetch, urls):
|
||||
|
||||
|
||||
<h3>Stats</h3>
|
||||
<p><a class="reference external" target="_blank" href="https://travis-ci.org/eventlet/eventlet"><img alt="Travis build" src="https://travis-ci.org/eventlet/eventlet.png"></a></p>
|
||||
<p><a class="reference external" target="_blank" href="https://travis-ci.org/eventlet/eventlet"><img alt="Travis build" src="https://travis-ci.org/eventlet/eventlet.svg?branch=master"></a></p>
|
||||
|
||||
<!--
|
||||
Here we insert Ohloh Project Basic Stats widget.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""The :mod:`zmq` module wraps the :class:`Socket` and :class:`Context` found in :mod:`pyzmq <zmq>` to be non blocking
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user