Closed serzhiio closed 1 year ago
Chunks::next
returns Ok(None)
when you've reached the end of the stream.
Yeah, but if i wait for this extra event i need to cache all stream data even if there is only one chunk.
And when receiving data with fin:true
flag i can parse it without caching bc i know i don't have to wait.
Your code needs to handle data being delivered in arbitrary chunks regardless.
As i see currently you need to call
.finish()
after all data is sent, and you need to wait forFinished
event to be sure data stream is fully drained. It would be more convenient, in my particular case, to receive this flag along with last portion of data, almost like WebSockets FIN flag. The Api could look like: