Question about client.Stream.recv_message
artificial-aidan opened this issue · 2 comments
The documentation states:
If server sends STREAM response, then you should call this coroutine several times, until it returns None.
What causes it to return None, is that when the stream closes? Or when the server stops sending messages? Should one continue reading from that stream and expect something non-None in the future? Or does a None mean it is closed?
After some more digging it looks like the coroutine returns None when the server exits the function successfully. This is a little odd to me, maybe I'll add something to the docs
I assumed that this is widely known behaviour. Like when you receive data from socket you get empty bytestring in the end of incoming stream. Like when you read data from file you get empty bytestring in the end of file.