How to verify all data has been sent on a stream

The main issue with this is that your server is now reliant on clients to close its writable stream. Each node should close its own writable when it is done writing or wont write at all.

Yes, I’m about to solve it. In my future architecture when the read end is closed, node should be able to send all responses to the write end and close the connection after it.

However, if you choose to stick with this solution, you will be able to use stream.source.end() (close the read side of the stream) instead of stream.close()

Closing the write side was my goal initially. As I see what you talking about is totally fine with it.

Thanks for the answer.