Not sure how to stream large amounts of data when the total size is unknown. #1562
Replies: 3 comments 1 reply
-
tryWrite is a good opinion, yes we should have it, but so far we only have write. You can stream small chunks with write of, let's say 4kb a time, checking the return of write, stopping when full, continuing in onWritable. |
Beta Was this translation helpful? Give feedback.
-
So write will use Transfer-Encoding: chunked and you can write as much you want until calling end |
Beta Was this translation helpful? Give feedback.
-
@uNetworkingAB Sorry for pushing myself into your conversation, So if I'm understanding correctly, when |
Beta Was this translation helpful? Give feedback.
-
I can see in examples and documentation how to stream large amounts of data when the total amount is known - use
tryEnd
andonWritable
. But tryEnd will close the stream when the total amount is reached and I need to start sending data down before I know what the total size will be. It would be useful if there was atryWrite
that worked similarly but didn't require knowing the total size right away.Beta Was this translation helpful? Give feedback.
All reactions