-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
remove tokio_util::block_on #3388
Conversation
CC @ry |
We can't actually remove it (instead of shifting to futures |
Well @95th that's what I wanted to do in this PR but Windows is acting up... I don't have a Windows machine to debug it |
/// This is useful when we want to block the main runtime to | ||
/// resolve a future without worrying that we'll use up all the threads in the | ||
/// main runtime. | ||
pub fn block_on<F, R>(future: F) -> Result<R, ErrBox> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy to see this go away. I think we still haven't really solved the core problem - but much better to be using futures::executor::block_on
rather than this home-brewed garbage. Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR removes tokio_util::block_on - refactored compiler and file fetcher slightly so that we can safely block there - that's because only blocking path consist of only synchronous operations. Additionally I removed excessive use of tokio_util::panic_on_error and tokio_util::run_in_task and moved both functions to cli/worker.rs, to tests module. Closes denoland#2960
This PR removes
tokio_util::block_on
- refactored compiler and file fetcher slightly so that we can safely block there - that's because only blocking path consist of only synchronous operations.Additionally I removed excessive use of
tokio_util::panic_on_error
andtokio_util::run_in_task
and moved both functions tocli/worker.rs
, totests
module.Closes #2960