WIP: Prototype azure_core WASM support via reqwest #1128
Closed
+38
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In a recent hackathon I managed to get
azure_core
compiled to WASM and making requests from a browser. This made use ofreqwest
's WASM support but did require a couple of hacks to work around the fact that it doesn't yet support streaming responses (although there is an open PR which does appear to add this: seanmonstar/reqwest#1576).Not sure whether you want to take any part of this, but thought I'd make it available in case you are interested!
The main changes are:
reqwest
and creation of areqwest
http client in thehttp_client
module when the target iswasm32
wasm32
target omit theSend
trait when usingasync_trait
wasm32
target remove support forBody::SeekableStream
bytes_stream(...)
function)wasm32
target removeSend + Sync
from thePinnedStream
definitionwasm-bindgen
that enablestime/wasm-bindgen
time
feature is not enabled then the retry policy code triggers a panic when querying the current time