I have a frontend written in React and a backend written in FastAPI. I want them to talk, either over websockets or socket.io. Right now I'm using socket.io. In either case, the same problem happens: if I send two messages in a row from fastapi, the first is not received until the second is ready. So it looks like this
SERVER SEND A
SERVER SEND B
CLIENT RECEIVE A
CLIENT RECEIVE B
I want it to look like this:
SERVER SEND A
CLIENT RECEIVE A
SERVER SEND B
CLIENT RECEIVE B
I'm sure I am doing something really dumb but would appreciate any pointers on this phenomenon.