Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
fix: only sleep when there are no futures to poll
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin-Niederman committed Jan 5, 2024
1 parent 8659f6b commit f0f3ae6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pros/src/async_runtime/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ impl Executor {
if let Poll::Ready(output) = Pin::new(&mut task).poll(&mut cx) {
return output;
}
self.tick();
// there might be another future to poll, so we continue without sleeping
continue;
}

self.tick();
delay(Duration::from_millis(10));
self.tick();
}
}

Expand Down

0 comments on commit f0f3ae6

Please sign in to comment.