1

On my current server, I have large blocks of calculations when I receive socketio events. (Server is using Flask + flask-socketio.)

I'm moving the server from local version serving only one user to cloud version serving company-wise.

I tested the tolerance of concurrency using multiple browser tabs to send requests within a short time. According to the test results, the current default concurrency offered by flask-socketio and eventlet doesn't seem enough.

After some investigation, I wanted to use asyncio, but in the end found no way to implement it together with Flask as well as flask-socketio. I found Quart to be a better option, which can support both asyncio and websocket at the same time.

Now the good thing is that I don't have to modify any Flask APIs, but for websocket, things are less clear:

Do I have to modify all my original socketio server-end event listeners to websocket routes which is used instead in Quart? Can I use python-socketio together with Quart? Can I at least keep the client-end socketio codes? -- They use event-based websocket requests, while Quart built-in websocket server seems to receive only url-based (or route-based) websocket requests.

Yan Yang
  • 1,804
  • 2
  • 15
  • 37

0 Answers0