Stream: git-wasmtime

Topic: wasmtime / issue #7090 Wasi input-stream: use same errors...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 30 2023 at 01:07):

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 like write, instead of changing write to work like read.

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 through poll_list and read 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.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 02 2023 at 16:42):

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