Different requests to same client at same time using Flask Socketio #1931
-
I am creating an offline live dashboard for updating data from client to server using Flask. I have multiple data to update and it works well if I send them in a single request. But I have two types of requests and one updates slower than another. Is there anyway to update the different requests simultaneously in the client? what I tried: I created another function and run the code as below. But only first value is updating and second isn't. what I need: Both test and test2 should be updated simultaneously with its own delay (test has no delay and test2 has 3 seconds delay). app.py:
index.html:
I am relatively new to flask websockets and any kind of help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I'm sorry, I don't understand. You are emitting This may be more a question about front end development, because I don't see how this can be solved from the Socket.IO side unless you combine your two data items into a single event. |
Beta Was this translation helpful? Give feedback.
I'm sorry, I don't understand. You are emitting
temp
events as fast as your server can, and you are emittingtemp2
every 3 seconds. How can the updates happen at the same time when the rates are different?This may be more a question about front end development, because I don't see how this can be solved from the Socket.IO side unless you combine your two data items into a single event.