sunfishcode commented on issue #7090:
Making input-stream use the same error type as output-stream is nice, however I'm curious why you chose to change
read
to work likewrite
, instead of changingwrite
to work likeread
.Read returning a
tuple<list<u8>, stream-status>
on success meant it could report a successful read with data and end-of-stream at the same time. The earlier idea was that hosts could eventually use that to save guests an extra trip throughpoll_list
andread
just to find out that the stream is closed. It's admittedly not urgent that we do that optimization right now, but unless there's a reason not to, it seems worth keeping the option in the interface.
pchickey commented on issue #7090:
My take on it was, its a very rare corner case that we can indicate the end of stream has been reached while still returning some input, whereas it makes the interface more difficult to understand, use, and implement. As we went through and changed the implementation and tests to this new interface, both "felt" more appropriate. It is subjective, and initially I did it the other way because that seemed like an advantage, but now that I've done it both ways I prefer this.
Last updated: Nov 22 2024 at 16:03 UTC