I am trying to support websocket in a exsiting flask app. It goes well by following example except the worker would timeout after 20 seconds(set for the flask app).
Following is the code added and I changed worker classs to geventwebsocket.gunicorn.workers.GeventWebSocketWorker
@sockets.route('/log')
def test_connect(socket):
while not socket.closed:
import time
time.sleep(2)
socket.send("heart beating")
My assumation is that the websocket connection is treated as a http request and expected to return a response in 20s before the greentlet timeout.
I am trying to support websocket in a exsiting flask app. It goes well by following example except the worker would timeout after 20 seconds(set for the flask app).
Following is the code added and I changed worker classs to
geventwebsocket.gunicorn.workers.GeventWebSocketWorker
My assumation is that the websocket connection is treated as a http request and expected to return a response in 20s before the greentlet timeout.
How should I handle this?