Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

feat: update to independent trailer retrieval#16

Merged
vados-cosmonic merged 4 commits intomainfrom
feat=update-to-independent-trailer-retrieval
Feb 26, 2025
Merged

feat: update to independent trailer retrieval#16
vados-cosmonic merged 4 commits intomainfrom
feat=update-to-independent-trailer-retrieval

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/types@0.3.0-draft#[static]body.finish",
            "wasi:http/handler@0.3.0-draft#handle",
        ]
    },

to

    async: {
        only_imports: [
            "wasi:http/handler@0.3.0-draft#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 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.

vados-cosmonic and others added 4 commits February 27, 2025 01:18
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 <vadossi@cosmonic.com>
Co-authored-by: Joel Dice <joel.dice@fermyon.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
@vados-cosmonic vados-cosmonic force-pushed the feat=update-to-independent-trailer-retrieval branch from a628d56 to 4bac09f Compare February 26, 2025 16:18
@vados-cosmonic vados-cosmonic merged commit 6a55a7f into main Feb 26, 2025
25 checks passed
@vados-cosmonic vados-cosmonic deleted the feat=update-to-independent-trailer-retrieval branch February 26, 2025 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants