Replies: 2 comments
-
Yep, that's the reason. See similar question: #1722 |
Beta Was this translation helpful? Give feedback.
0 replies
-
An example to make this work would be really helpfull. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Im trying to use the
reqwest::Response
on wasm, but it has to pass through multiple functions and.awaits
.Unfortunately,
Response
is not Send/Sync so this makes it difficult to use http calls in the background.Is there something im missing, or is this only because web_sys::Response isnt Send/sync?
This makes it hard to use with tokio threading for example.
Example the following code:
using this in a task example like this:
gives errors similar to this:
the trait std::marker::Send is not implemented for Rc<RefCell<wasm_bindgen_futures::Inner>>
orwithin reqwest::Response, the trait Sync is not implemented for *mut u8
I can of course wrap all spawn tasks in a wasm check and spawn local if were in wasm, but thats not really elegant.
Is there a solution for this, or do we need to wait for better threading support?
Beta Was this translation helpful? Give feedback.
All reactions