@@ -19,9 +19,10 @@ features:
19
19
Socket.IO specification.
20
20
- Compatible with Python 2.7 and Python 3.3+.
21
21
- Supports large number of clients even on modest hardware when used with an
22
- asynchronous server based on `asyncio <https://docs.python.org/3/library/asyncio.html >`_,
23
- `eventlet <http://eventlet.net/ >`_ or `gevent <http://gevent.org/ >`_. For
24
- development and testing, any WSGI complaint multi-threaded server can also be
22
+ asynchronous server based on `asyncio <https://docs.python.org/3/library/asyncio.html >`_
23
+ (`sanic <http://sanic.readthedocs.io/ >`_ and `aiohttp <http://aiohttp.readthedocs.io/ >`_),
24
+ `eventlet <http://eventlet.net/ >`_ or `gevent <http://gevent.org >`_. For
25
+ development and testing, any WSGI compliant multi-threaded server can also be
25
26
used.
26
27
- Includes a WSGI middleware that integrates Socket.IO traffic with standard
27
28
WSGI applications.
@@ -458,14 +459,40 @@ Deployment
458
459
The following sections describe a variety of deployment strategies for
459
460
Socket.IO servers.
460
461
461
- Aiohttp
462
+ Sanic
463
+ ~~~~~
464
+
465
+ `Sanic <http://sanic.readthedocs.io/ >`_ is a very efficient asynchronous web
466
+ server for Python 3.5 and newer.
467
+
468
+ Instances of class ``socketio.AsyncServer `` will automatically use Sanic for
469
+ asynchronous operations if the framework is installed. To request its use
470
+ explicitly, the ``async_mode `` option can be given in the constructor::
471
+
472
+ sio = socketio.AsyncServer(async_mode='sanic')
473
+
474
+ A server configured for aiohttp must be attached to an existing application::
475
+
476
+ app = web.Application()
477
+ sio.attach(app)
478
+
479
+ The Sanic application can define regular routes that will coexist with the
480
+ Socket.IO server. A typical pattern is to add routes that serve a client
481
+ application and any associated static files.
482
+
483
+ The Sanic application is then executed in the usual manner::
484
+
485
+ if __name__ == '__main__':
486
+ app.run()
487
+
488
+ aiohttp
462
489
~~~~~~~
463
490
464
491
`Aiohttp <http://aiohttp.readthedocs.io/ >`_ is a framework with support for HTTP
465
492
and WebSocket, based on asyncio. Support for this framework is limited to Python
466
493
3.5 and newer.
467
494
468
- Instances of class ``engineio .AsyncServer `` will automatically use aiohttp
495
+ Instances of class ``socketio .AsyncServer `` will automatically use aiohttp
469
496
for asynchronous operations if the library is installed. To request its use
470
497
explicitly, the ``async_mode `` option can be given in the constructor::
471
498
0 commit comments