Eventlet Documentation¶
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",
"http://python.org/images/python-logo.gif",
"http://us.i1.yimg.com/us.yimg.com/i/ww/beta/y3.gif",
]
import eventlet
from eventlet.green.urllib.request import urlopen
def fetch(url):
return urlopen(url).read()
pool = eventlet.GreenPool()
for body in pool.imap(fetch, urls):
print("got body", len(body))
Supported Python versions¶
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.
Contents¶
- Basic Usage
- Primary API
- Design Patterns
- Greening The World
- Examples
- Using SSL With Eventlet
- Threads
- Zeromq
- Understanding Eventlet Hubs
- Testing Eventlet
- Environment Variables
- Module Reference
backdoor– Python interactive interpreter within a running processcorolocal– Coroutine local storagedagpool– Dependency-Driven Greenthreads- Module Contents
debug– Debugging tools for Eventletdb_pool– DBAPI 2 database connection poolingevent– Cross-greenthread primitivegreenpool– Green Thread Poolsgreenthread– Green Thread Implementationpools- Generic pools of resourcesqueue– Queue classsemaphore– Semaphore classestimeout– Universal Timeoutswebsocket– Websocket Serverwsgi– WSGI servereventlet.green.zmq– ØMQ support
- Authors
- History
License¶
Eventlet is made available under the terms of the open source MIT license