File: examples.rst

package info (click to toggle)
python-eventlet 0.26.1-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,916 kB
  • sloc: python: 24,898; makefile: 98
file content (106 lines) | stat: -rw-r--r-- 2,528 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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_example:

Web Crawler
------------
``examples/webcrawler.py``

.. literalinclude:: ../examples/webcrawler.py

.. _wsgi_server_example:

WSGI Server
------------
``examples/wsgi.py``

.. literalinclude:: ../examples/wsgi.py

.. _echo_server_example:

Echo Server
-----------
``examples/echoserver.py``

.. literalinclude:: ../examples/echoserver.py

.. _socket_connect_example:

Socket Connect
--------------
``examples/connect.py``

.. literalinclude:: ../examples/connect.py

.. _chat_server_example:

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.
        
.. literalinclude:: ../examples/chat_server.py

.. _feed_scraper_example:

Feed Scraper
-----------------------
``examples/feedscraper.py``

This example requires `Feedparser <http://www.feedparser.org/>`_ to be installed or on the PYTHONPATH.

.. literalinclude:: ../examples/feedscraper.py

.. _forwarder_example:

Port Forwarder
-----------------------
``examples/forwarder.py``

.. literalinclude:: ../examples/forwarder.py

.. _recursive_crawler_example:

Recursive Web Crawler
-----------------------------------------
``examples/recursive_crawler.py``

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

.. literalinclude:: ../examples/recursive_crawler.py

.. _producer_consumer_example:

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.

.. literalinclude:: ../examples/producer_consumer.py

.. _websocket_example:

Websocket Server Example
--------------------------
``examples/websocket.py``

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

.. literalinclude:: ../examples/websocket.py

.. _websocket_chat_example:

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.

.. literalinclude:: ../examples/websocket_chat.py