Updating a websocket connection in a single thread in Flask application I have a flask up with an endpoint like below