Skip to content

Commit 5c882ac

Browse files
readme files and requirements for all examples
1 parent 6f41206 commit 5c882ac

File tree

5 files changed

+127
-45
lines changed

5 files changed

+127
-45
lines changed

examples/README.rst

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,15 @@
1-
Engine.IO Examples
1+
Socket.IO Examples
22
==================
33

4-
This directory contains example Engine.IO applications.
4+
This directory contains several example Socket.IO applications, organized by
5+
directory:
56

6-
app.py
7-
------
7+
wsgi
8+
----
89

9-
A basic "kitchen sink" type application that allows the user to experiment
10-
with most of the available features of the server.
10+
Examples that are compatible with the WSGI protocol and frameworks.
1111

12-
latency.py
13-
----------
12+
aiohttp
13+
-------
1414

15-
A port of the latency application included in the official Engine.IO
16-
Javascript server. In this application the client sends *ping* messages to
17-
the server, which are responded by the server with a *pong*. The client
18-
measures the time it takes for each of these exchanges and plots these in real
19-
time to the page.
20-
21-
This is an ideal application to measure the performance of the different
22-
asynchronous modes supported by the Socket.IO server.
23-
24-
Running the Examples
25-
--------------------
26-
27-
To run these examples using the default ``'threading'`` mode, create a virtual
28-
environment, install the requirements and then run::
29-
30-
$ python app.py
31-
32-
or::
33-
34-
$ python latency.py
35-
36-
Near the top of the ``app.py`` and ``latency.py`` source files there is a
37-
``async_mode`` variable that can be edited to swich to the other asynchornous
38-
modes. Accepted values for ``async_mode`` are ``'threading'``, ``'eventlet'``
39-
and ``'gevent'``.
40-
41-
Note 1: when using the ``'eventlet'`` mode, the eventlet package must be
42-
installed in the virtual environment::
43-
44-
$ pip install eventlet
45-
46-
Note 2: when using the ``'gevent'`` mode, the gevent and gevent-websocket
47-
packages must be installed in the virtual environment::
48-
49-
$ pip install gevent gevent-websocket
15+
Examples that are compatible with the aiohttp framework for asyncio.

examples/aiohttp/README.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Socket.IO aiohttp Examples
2+
==========================
3+
4+
This directory contains example Socket.IO applications that are compatible with
5+
asyncio and the aiohttp framework. These applications require Python 3.5 or
6+
later.
7+
8+
app.py
9+
------
10+
11+
A basic "kitchen sink" type application that allows the user to experiment
12+
with most of the available features of the Socket.IO server.
13+
14+
latency.py
15+
----------
16+
17+
A port of the latency application included in the official Engine.IO
18+
Javascript server. In this application the client sends *ping* messages to
19+
the server, which are responded by the server with a *pong*. The client
20+
measures the time it takes for each of these exchanges and plots these in real
21+
time to the page.
22+
23+
This is an ideal application to measure the performance of the different
24+
asynchronous modes supported by the Socket.IO server.
25+
26+
Running the Examples
27+
--------------------
28+
29+
To run these examples, create a virtual environment, install the requirements
30+
and then run::
31+
32+
$ python app.py
33+
34+
or::
35+
36+
$ python latency.py
37+
38+
You can then access the application from your web browser at
39+
``http://localhost:8080``.

examples/aiohttp/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
aiohttp==1.3.1
2+
async-timeout==1.1.0
3+
chardet==2.3.0
4+
multidict==2.1.4
5+
python-engineio
6+
python_socketio
7+
six==1.10.0
8+
yarl==0.9.2

examples/wsgi/README.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Socket.IO WSGI Examples
2+
=======================
3+
4+
This directory contains example Socket.IO applications that work together with
5+
WSGI frameworks. These examples all use Flask to serve the client application to
6+
the web browser, but they should be easily adapted to use other WSGI compliant
7+
frameworks.
8+
9+
app.py
10+
------
11+
12+
A basic "kitchen sink" type application that allows the user to experiment
13+
with most of the available features of the Socket.IO server.
14+
15+
latency.py
16+
----------
17+
18+
A port of the latency application included in the official Engine.IO
19+
Javascript server. In this application the client sends *ping* messages to
20+
the server, which are responded by the server with a *pong*. The client
21+
measures the time it takes for each of these exchanges and plots these in real
22+
time to the page.
23+
24+
This is an ideal application to measure the performance of the different
25+
asynchronous modes supported by the Socket.IO server.
26+
27+
Running the Examples
28+
--------------------
29+
30+
To run these examples, create a virtual environment, install the requirements
31+
and then run::
32+
33+
$ python app.py
34+
35+
or::
36+
37+
$ python latency.py
38+
39+
You can then access the application from your web browser at
40+
``http://localhost:5000``.
41+
42+
Near the top of the ``app.py`` and ``latency.py`` source files there is a
43+
``async_mode`` variable that can be edited to swich to the other asynchornous
44+
modes. Accepted values for ``async_mode`` are ``'threading'``, ``'eventlet'``
45+
and ``'gevent'``.
46+
47+
Note 1: when using the ``'eventlet'`` mode, the eventlet package must be
48+
installed in the virtual environment::
49+
50+
$ pip install eventlet
51+
52+
Note 2: when using the ``'gevent'`` mode, the gevent and gevent-websocket
53+
packages must be installed in the virtual environment::
54+
55+
$ pip install gevent gevent-websocket

examples/wsgi/requirements.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
python-engineio==0.6.5
2-
six==1.9.0
1+
appdirs==1.4.0
2+
click==6.7
3+
enum-compat==0.0.2
4+
enum34==1.1.6
5+
eventlet==0.20.1
6+
Flask==0.12
7+
greenlet==0.4.12
8+
itsdangerous==0.24
9+
Jinja2==2.9.5
10+
MarkupSafe==0.23
11+
packaging==16.8
12+
pyparsing==2.1.10
13+
python-engineio
14+
python-socketio
15+
six==1.10.0
16+
Werkzeug==0.11.15

0 commit comments

Comments
 (0)