deb-python-eventlet/doc/examples.rst

2.5 KiB

Examples

Here are a bunch of small example programs that use Eventlet. All of these examples can be found in the examples directory of a source copy of Eventlet.

Web Crawler

examples/webcrawler.py

../examples/webcrawler.py

WSGI Server

examples/wsgi.py

../examples/wsgi.py

Echo Server

examples/echoserver.py

../examples/echoserver.py

Socket Connect

examples/connect.py

../examples/connect.py

Multi-User Chat Server

examples/chat_server.py

This is a little different from the echo server, in that it broadcasts the messages to all participants, not just the sender.

../examples/chat_server.py

Feed Scraper

examples/feedscraper.py

This example requires Feedparser to be installed or on the PYTHONPATH.

../examples/feedscraper.py

Port Forwarder

examples/forwarder.py

../examples/forwarder.py

Recursive Web Crawler

examples/recursive_crawler.py

This is an example recursive web crawler that fetches linked pages from a seed url.

../examples/recursive_crawler.py

Producer Consumer Web Crawler

examples/producer_consumer.py

This is an example implementation of the producer/consumer pattern as well as being identical in functionality to the recursive web crawler.

../examples/producer_consumer.py

Websocket Server Example

examples/websocket.py

This exercises some of the features of the websocket server implementation.

../examples/websocket.py

Websocket Multi-User Chat Example

examples/websocket_chat.py

This is a mashup of the websocket example and the multi-user chat example, showing how you can do the same sorts of things with websockets that you can do with regular sockets.

../examples/websocket_chat.py