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

Figure out how to support streaming bodies for WASM target #293

Closed
heaths opened this issue Jun 11, 2021 · 4 comments
Closed

Figure out how to support streaming bodies for WASM target #293

heaths opened this issue Jun 11, 2021 · 4 comments
Labels
Azure.Core The azure_core crate wasm WebAssembly support

Comments

@heaths
Copy link
Member

heaths commented Jun 11, 2021

In PR #288 the initial check failed because azure_core::TransportPolicy does not implement azure_core::Policy for WASM. Previously this didn't matter because you'd hve to pass in a transport policy to Pipeline::new() and it was only defined as Arc<dyn Policy>; however, with the changes to be more consistent with other languages' SDK, azure_core now creates the TransportPolicy.

As part of #37 we do want to support WASM so we need to figure out the transport story. If/when reqwest supports WASM we could probably just remove #[cfg(not(target_arch = "wasm32"))] from sdk/core/src/policies/transport.rs; otherwise, we may need a WASM-specific transport to use the browser sandbox's network stack.

@ctaggart
Copy link
Contributor

reqwest does support WASM. https://github.com/seanmonstar/reqwest

@heaths
Copy link
Member Author

heaths commented Jun 15, 2021

I guess we need to figure out why we have - or need to tighten up - the cfg condition above in various places. For example, we currently don't create an implementation of HttpClient for WASM but sounds like we could. We default to reqwest anyway (default feature).

@rylev
Copy link
Contributor

rylev commented Jun 16, 2021

The issue isn't around the usage of reqwest in general. The issue is that reqwest does not support streaming bodies in wasm. For instance, reqwest::Body::wrap_stream is not available in wasm. We need to figure out how we reconcile this.

This is why it might be necessary to not use reqwest for wasm targets so that we can build in streaming support.

@rylev rylev changed the title Figure out transport story for WASM support Figure out how to support streaming bodies for WASM target Jun 16, 2021
@cataggar cataggar added wasm WebAssembly support Azure.Core The azure_core crate labels Oct 26, 2021
@johnbatty
Copy link
Contributor

@rylev Looks like this reqwest PR might provide the required streaming body support?
seanmonstar/reqwest#1576

@cataggar cataggar closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core The azure_core crate wasm WebAssembly support
Projects
None yet
Development

No branches or pull requests

5 participants