Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to independent trailer retrieval #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vados-cosmonic
Copy link
Collaborator

No description provided.

@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch 2 times, most recently from e518332 to 65c6e80 Compare February 19, 2025 12:15
Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I agree with WebAssembly/wasi-http#154 (comment) that the return type should be future<option<trailers>> rather than option<future<trailers>>.

@vados-cosmonic
Copy link
Collaborator Author

vados-cosmonic commented Feb 19, 2025

Yup, just made a comment over there -- that was more an artifact of what the Body provides -- going to write a little transpose() to push the Option in -- I'd like to avoid having to wrap in another future invocation though that would be the easiest way.

@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch from 54c09c3 to cbf69ec Compare February 19, 2025 20:33
@vados-cosmonic vados-cosmonic requested a review from dicej February 20, 2025 17:53
@vados-cosmonic
Copy link
Collaborator Author

Alright @dicej thanks for the feedback, this is ready now. Going to put off updating the wit completely (removing body.constructor, etc) until after upstream WIT changes and this initial PR merges!

@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch 5 times, most recently from 62c8e1f to 6faa5e2 Compare February 24, 2025 09:32
Copy link
Collaborator

@dicej dicej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One suggestion: at the top of component-async-tests/http/src/lib.rs, we could change

    async: {
        only_imports: [
            "wasi:http/[email protected]#[static]body.finish",
            "wasi:http/[email protected]#handle",
        ]
    },

to

    async: {
        only_imports: [
            "wasi:http/[email protected]#handle",
        ]
    },

and likewise in the wit_bindgen::generate! macro invocations in e.g. async_http_echo.rs since body.finish no longer needs to be implemented or called async.

@vados-cosmonic
Copy link
Collaborator Author

vados-cosmonic commented Feb 24, 2025

Hey @dicej I'm not sure we can do that -- since we need to create that future in the case there are no trailers -- and for that I need access to the store (which I currently get via the Accessor)

@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch from 508415b to a90ef47 Compare February 24, 2025 16:45
@vados-cosmonic vados-cosmonic requested a review from dicej February 24, 2025 16:49
vados-cosmonic and others added 3 commits February 25, 2025 05:43
This commit updates `wasi:http/types#body.finish` to avoid resolving
optional trailers, but instead returning them for the caller to
resolve.

This may introduce some efficiency gains in the cases where trailers
can be safely ignored, and does avoid the work done in checking
whether they are present or not, at least.

Signed-off-by: Victor Adossi <[email protected]>
@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch from 8ea2715 to 066bf85 Compare February 24, 2025 20:43
@dicej
Copy link
Collaborator

dicej commented Feb 25, 2025

Hey @dicej I'm not sure we can do that -- since we need to create that future in the case there are no trailers -- and for that I need access to the store (which I currently get via the Accessor)

Good point. Let's leave the host side async but make the guest side sync, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants