I am running into problems when trying to work with streamed query response. everything works correctly when using the following code and flask development server:
response = query_engine.query(question)
full_answer = ""
for token in response.response_gen:
full_answer = full_answer + token
emit("answer", {"token": token})
however, when using gunicorn and eventlet or gevent worker (need to use one of those because I want to use websockets to be able to stream the response to client), the code hangs at the for loop line and no iteration of the loop is executed. I assume the code needs to written differently to work with the gunicorn workers, does anybody have any experience with this?