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
tokio::task::yield_now() is not completely yields and fetch never completes #2979
Comments
Your is not running in a Tokio runtime. |
Thanks. In that case is there some similar "yield" feature ? wasm_timer could be an option, but that crate seems to be not maintained any more and the latest release has some issue: tomaka/wasm-timer#14 |
fluvio-wasm-timer works for this. |
Yes, this is what I've also linked (one of the last comment in the issue), but as its documentation states it is just a temporal solution which is not too convincing and does not seems to be a stable solution: |
Does gloo-timers solve the problem for you? |
hm, seems to be backed up by a working group for wasm but never heard of it before. Thank I will give it a try. |
It's in the same organization as this repository, though I'm currently the only one maintaining it. If you encounter any issues, please file them at https://github.com/rustwasm/gloo |
Please be aware that |
@Darksonn would you consider this (completely single threaded) (or this (uses atomics)) to be a "runtime" where yield_now works? If so, what should it actually be doing? Note that spawn_local calls |
From my point of view I've managed to solve my issue with some refactor that don't require yield any more (and that is a much preferred solution). Thanks for the valuable comments on all forums/threads, now I have a bit better understanding of the system. If you feel as the wasm bindgen runtime can be improved anyway w.r.t the original question, than please keep this ticket open, but from my side I'd suggest closing it. |
@hamza1311 Whether |
Description
See the provided code sample.
When tokio yield_now is used, the fetch_with_request never resolves. Both loop performs a few steps but fetch_with_request never completes when yield_now is used (The Fetching... is logged, but unreachable is never reached). If I replace it with wasm_timer::Delay with a 0 Duration, the fetch works as expected and the download completes with either success or error.
The error was originally reported in for tokio but it seems as this is the correct place to report/ask.
The text was updated successfully, but these errors were encountered: