You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You cannot use normal Future Spawners with wasm (this is because wasm currently does not support threads). Instead, you should use the spawn_local function in the wasm-bindgen-futures crate (or just use an async main function with #[wasm_bindgen]).
As for the more general problem of impling Send, that will likely never happen, because JS values fundamentally cannot be sent between threads (even when wasm eventually gets threads).
I've thought about implementing something similar to send_wrapper (thanks for the link), but that will have to wait until we have hands-on experience with wasm threads.
Activity
expenses commentedon Jan 15, 2020
This can be fixed by using https://crates.io/crates/send_wrapper.
Pauan commentedon Jan 18, 2020
You cannot use normal Future Spawners with wasm (this is because wasm currently does not support threads). Instead, you should use the
spawn_localfunction in the wasm-bindgen-futures crate (or just use anasyncmain function with#[wasm_bindgen]).As for the more general problem of impling
Send, that will likely never happen, because JS values fundamentally cannot be sent between threads (even when wasm eventually gets threads).I've thought about implementing something similar to send_wrapper (thanks for the link), but that will have to wait until we have hands-on experience with wasm threads.