Make cx.spawn() return an Option<TaskId>, returns None if finished immediately
This commit is contained in:
1 parent
695bf009d1
commit
69ca1fd8a7
8 files changed
+38
-37
No files matched your search
@@ -49,10 +49,10 @@ where
|
||||
let val = val.clone();
|
||||
let task = state.task.clone();
|
||||
|
||||
state.task.set(Some(cx.push_future(async move {
|
||||
state.task.set(cx.push_future(async move {
|
||||
val.set(Some(fut.await));
|
||||
task.take();
|
||||
})));
|
||||
}));
|
||||
|
||||
// Mark that we don't need to regenerate
|
||||
state.needs_regen.set(false);
|
||||
|
||||
Reference in new issue
Block a user