@@ -16,9 +16,9 @@ pub struct Job {
17#[derive(Default)]
17#[derive(Default)]
18pub struct Jobs {
18pub struct Jobs {
19− futures: FuturesUnordered<JobFuture>,
19+ pub futures: FuturesUnordered<JobFuture>,
20 /// These are the ones that need to complete before we exit.
20 /// These are the ones that need to complete before we exit.
21− wait_futures: FuturesUnordered<JobFuture>,
21+ pub wait_futures: FuturesUnordered<JobFuture>,
@@ -77,11 +77,11 @@ impl Jobs {
82− ) -> impl Future<Output = Option<anyhow::Result<Option<Callback>>>> + '_ {
80+ pub async fn next_job(&mut self) -> Option<anyhow::Result<Option<Callback>>> {
82+ event = self.futures.next() => { event }
83− future::select(self.futures.next(), self.wait_futures.next())
83+ event = self.wait_futures.next() => { event }
84− .map(|either| either.factor_first().0)
84+ }
87 pub fn add(&mut self, j: Job) {
87 pub fn add(&mut self, j: Job) {