Add spawn_blocking to SubsystemContext (#1570)

* subsystem: add spawn_blocking to SubsystemContext

* candidate-validation: use spawn_blocking for exhaustive tasks
This commit is contained in:
Andronik Ordian authored and GitHub committed 2020-08-17 12:26:32 +00:00
1 parent cf7133cbcf
commit ab1a513265
4 files changed
+42 -2

No files matched your search

@@ -177,6 +177,13 @@ impl<M: Send + 'static, S: SpawnNamed + Send + 'static> SubsystemContext for Tes
Ok(())
}
async fn spawn_blocking(&mut self, name: &'static str, s: Pin<Box<dyn Future<Output = ()> + Send>>)
-> SubsystemResult<()>
{
self.spawn.spawn_blocking(name, s);
Ok(())
}
async fn send_message(&mut self, msg: AllMessages) -> SubsystemResult<()> {
self.tx.send(msg).await.expect("test overseer no longer live");
Ok(())