heroku-python / flask-sockets

[DEPRECATED] Alternative: https://github.com/miguelgrinberg/flask-sock
MIT License
1.74k stars 167 forks source link

websocket worker timeout #53

Closed panjianjun closed 7 years ago

panjianjun commented 7 years ago

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.

How should I handle this?

panjianjun commented 7 years ago

fount it's my own problem, sorry for the trouble