Stream: git-wasmtime

Topic: wasmtime / PR #7234 Implement stream splice, delete forward


view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:21):

pchickey edited PR #7234:

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:21):

pchickey has marked PR #7234 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:21):

pchickey requested fitzgen for a review on PR #7234.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:21):

pchickey requested wasmtime-core-reviewers for a review on PR #7234.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:28):

pchickey requested sunfishcode for a review on PR #7234.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:35):

pchickey edited PR #7234:

This PR implements output-stream.splice and blocking-splice.

The wit definitions for these functions has been changed to take a borrow<input-stream>, rather than the owned resource.

Splice performs the equivalent to:

By implementing this in the host using the HostInputStream and HostOutputStream traits, the read and write are done in terms of Bytes representation, so there are zero copies of the underlying data made as part of the splice.

A blocking splice waits for both read and write readiness before performing those operations.

The output-stream.forward method has been deleted from the wit. We believe that the fusion of an output-stream into an input-stream (which gives up ownership of both resources, and happens perpetually in the background) is a worthwhile concept to implement some day, but it raises various questions on how progress and errors can be reported, and whether the background work can outlive the calling component, so rather than open that can of worms now we are going to ask users to implement it with their own event loops using splice for now, and look at adding it again in the future.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:41):

pchickey updated PR #7234.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 13 2023 at 17:55):

pchickey updated PR #7234.

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

pchickey requested alexcrichton for a review on PR #7234.

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

alexcrichton submitted PR review.

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

alexcrichton submitted PR review.

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

alexcrichton created PR review comment:

Same as above, this and below may no longer be necessary?

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

alexcrichton created PR review comment:

no longer necessary I think?

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

pchickey submitted PR review.

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

pchickey created PR review comment:

You do need to give up the borrow of output before creating input below, because they are both mut borrows into the table. I changed this to use blocks instead of explicit drops to make it a little more obvious.

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

pchickey updated PR #7234.

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

alexcrichton submitted PR review.

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

alexcrichton created PR review comment:

Oh? I would imagine that NLL fixes this because let _: &mut T = val; AFAIK does nothing in terms of lifetime inference

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

pchickey submitted PR review.

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

pchickey created PR review comment:

oh. yes, you're right. im not sure what error message i was trying to get around by writing it that way, but it isnt necessary. at any rate i like the way its written now.

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

pchickey merged PR #7234.


Last updated: Nov 22 2024 at 17:03 UTC