make ctx.spawn blocking (#3337)

* make spawn sync

* improve error type
This commit is contained in:
Andronik Ordian authored and GitHub committed 2021-06-21 20:43:40 -05:00
1 parent 9fa5d28e0b
commit ffc6f7c731
16 files changed
+27 -80

No files matched your search

+2 -2
View File
@@ -726,9 +726,9 @@ impl<Job: JobTrait, Spawner> JobSubsystem<Job, Spawner> {
}
outgoing = jobs.next() => {
let res = match outgoing.expect("the Jobs stream never ends; qed") {
FromJobCommand::Spawn(name, task) => ctx.spawn(name, task).await,
FromJobCommand::Spawn(name, task) => ctx.spawn(name, task),
FromJobCommand::SpawnBlocking(name, task)
=> ctx.spawn_blocking(name, task).await,
=> ctx.spawn_blocking(name, task),
};
if let Err(e) = res {