2

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.

forefinger
  • 3,767
  • 1
  • 22
  • 18
  • Please have a look at related answers [here](https://stackoverflow.com/a/70626324/17865804) and [here](https://stackoverflow.com/a/70996841/17865804) – Chris Apr 28 '23 at 09:26

0 Answers0