-
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
Use futures 0.3 API #3358
Use futures 0.3 API #3358
Conversation
081ab42
to
5224d11
Compare
I had to disable |
bcddb1c
to
f2c089e
Compare
@@ -119,14 +122,14 @@ impl SourceFileFetcher { | |||
pub fn fetch_source_file_async( | |||
self: &Self, | |||
specifier: &ModuleSpecifier, | |||
) -> Box<SourceFileFuture> { | |||
) -> Pin<Box<SourceFileFuture>> { |
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.
What is the Pin for?
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.
Nice work @afinch7 ! Still combing through this - but I will land it today modulo a serious problem.
use futures::Future; | ||
use futures::Poll; | ||
use futures::compat::AsyncRead01CompatExt; | ||
use futures::compat::AsyncWrite01CompatExt; |
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.
It's very helpful that they've included this.
let first_msg_fut = async move { | ||
worker.post_message(req_msg).await.unwrap(); | ||
let result = worker.await; | ||
if let Err(err) = result { |
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.
Nice!
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 - thank you very much @afinch7 and @bartlomieju
After landing #3358 the benchmarks exploded indicating problems with workers and deno_core_http_bench. This PR dramatically fixes thread/syscall count that showed up on benchmarks. Thread count is not back to previous levels but difference went from hundreds/thousands to about ~50.
Some tests were silently failing after #3358 and #3434 because pool.spawn_ok was used which doesn't panic on errors. For reference, the failure looked like this: thread '<unnamed>' panicked at 'assertion failed: match isolate.poll_unpin(cx) { Poll::Ready(Ok(_)) => true, _ => false, }', core/isolate.rs:1408:7
After landing denoland#3358 the benchmarks exploded indicating problems with workers and deno_core_http_bench. This PR dramatically fixes thread/syscall count that showed up on benchmarks. Thread count is not back to previous levels but difference went from hundreds/thousands to about ~50.
Some tests were silently failing after denoland#3358 and denoland#3434 because pool.spawn_ok was used which doesn't panic on errors. For reference, the failure looked like this: thread '<unnamed>' panicked at 'assertion failed: match isolate.poll_unpin(cx) { Poll::Ready(Ok(_)) => true, _ => false, }', core/isolate.rs:1408:7
This is #3299 by @afinch7 - I'm just trying to get it to green