-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
wasi-http: Allow embedder to manage outgoing connections #7288
wasi-http: Allow embedder to manage outgoing connections #7288
Conversation
I was wondering if |
c1f982e
to
605d839
Compare
This adds a new `send_request` method to `WasiHttpView`, allowing embedders to override the default implementation with their own if the desire. The default implementation behaves exactly as before. I've also added a few new `wasi-http` tests: one to test the above, and two others to test streaming and concurrency. These tests are ports of the `test_wasi_http_echo` and `test_wasi_http_hash_all` tests in the [Spin](https://github.com/fermyon/spin) integration test suite. The component they instantiate is likewise ported from the Spin `wasi-http-rust-streaming-outgoing-body` component. Fixes bytecodealliance#7259 Signed-off-by: Joel Dice <[email protected]>
605d839
to
7deaae4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, thank you!
fn send_request( | ||
&mut self, | ||
request: OutgoingRequest, | ||
) -> wasmtime::Result<Resource<HostFutureIncomingResponse>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so much simpler than what I was assuming we'd need, nice work!
Yes, thank you Joel, I really like how the design of this worked out. |
This is a backport of bytecodealliance#7288, minus the tests. The test suite has been refactored since the release-14.0.0 branch was created, so backporting the tests would be complicated and not worth the effort. Signed-off-by: Joel Dice <[email protected]>
This is a backport of #7288, minus the tests. The test suite has been refactored since the release-14.0.0 branch was created, so backporting the tests would be complicated and not worth the effort. Signed-off-by: Joel Dice <[email protected]>
This adds a new
send_request
method toWasiHttpView
, allowing embedders to override the default implementation with their own if they desire. The default implementation behaves exactly as before.I've also added a few new
wasi-http
tests: one to test the above, and two others to test streaming and concurrency. These tests are ports of thetest_wasi_http_echo
andtest_wasi_http_hash_all
tests in the Spin integration test suite. The component they instantiate is likewise ported from the Spinwasi-http-rust-streaming-outgoing-body
component.Fixes #7259