-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anyone using python-socketio with sanic? #356
Comments
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. |
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.
The text was updated successfully, but these errors were encountered: