首页 > 解决方案 > Python websocket stream large results

问题描述

How do you stream large results when using websocket in python. Assume ws.recv() returns a very large data. Can I stream the returns per line or something? kind of like response.iter_lines() when using requests library. So that it wont buffer the entire results to the response variable

ws = websocket.create_connection(url)
ws.send(message)
response = ws.recv()
print(response)

标签: pythonwebsocket

解决方案


推荐阅读