Handle multiple batches in serial scheduler
Check to see if a batch is currently in-flight when trying to send the
next in schedule
try the next in schedule when a result is returned and the batch has
been complete
@@ -156,6 +156,10 @@ impl SchedulerCore {
return Ok(());
}
+ if self.current_batch.is_some() {
+ return Ok(());
+ }
+
let mut shared = self
.shared_lock
.lock()
@@ -222,6 +226,7 @@ impl SchedulerCore {
let batch_result = BatchExecutionResult { batch, results };
+ {
let shared = self
.shared_lock
.lock()
@@ -238,6 +243,9 @@ impl SchedulerCore {
}
}
}
+
+ self.try_schedule_next()?;
+ }
Ok(CoreMessage::Next) => {
self.next_ready = true;
self.try_schedule_next()?;
