Hi, i'm sorry that this is not even a issue. i was wondering if anyone has tried http://python-socketio.readthedocs.io/en/latest/ with sanic.
I don't think that library is asyncio. For asyncio WebSockets, you might want to look at:
https://websockets.readthedocs.io/en/stable/
There's some interest in creating a sanic extension for web sockets in issue #12.
closing in favor of #12
Author of python-socketio here. I have recently added support for asyncio, and have implemented integrations for aiohttp and sanic. The aiohttp integration supports long-polling and websocket. Sanic only supports long-polling.
Here are a couple of examples for sanic: https://github.com/miguelgrinberg/python-socketio/tree/master/examples/sanic.
@miguelgrinberg I tried to use sanic with socketio, but whenever I try to start sanic with multiple workers, the socket crashes and no connection is made! what is the solution?
You need to use a single worker process. The SocketIO is a stateful service, it cannot work with multiple workers. The alternative is to start several single-process servers, and put them behind a reverse proxy such as nginx configured with sticky sessions.
Most helpful comment
Author of python-socketio here. I have recently added support for asyncio, and have implemented integrations for aiohttp and sanic. The aiohttp integration supports long-polling and websocket. Sanic only supports long-polling.
Here are a couple of examples for sanic: https://github.com/miguelgrinberg/python-socketio/tree/master/examples/sanic.