only poll suspended futures
This commit is contained in:
1 parent
608fec59e5
commit
c9603ea984
7 files changed
+140
-46
No files matched your search
@@ -1,3 +1,5 @@
|
||||
use rustc_hash::FxHashSet;
|
||||
|
||||
use crate::{
|
||||
innerlude::{LocalTask, SchedulerMsg},
|
||||
render_signal::RenderSignal,
|
||||
@@ -24,11 +26,14 @@ pub struct Runtime {
|
||||
// We use this to track the current task
|
||||
pub(crate) current_task: Cell<Option<Task>>,
|
||||
|
||||
pub(crate) rendering: Cell<bool>,
|
||||
|
||||
/// Tasks created with cx.spawn
|
||||
pub(crate) tasks: RefCell<slab::Slab<Rc<LocalTask>>>,
|
||||
|
||||
// Currently suspended tasks
|
||||
pub(crate) suspended_tasks: RefCell<FxHashSet<Task>>,
|
||||
|
||||
pub(crate) rendering: Cell<bool>,
|
||||
|
||||
pub(crate) sender: futures_channel::mpsc::UnboundedSender<SchedulerMsg>,
|
||||
|
||||
// Synchronous tasks need to be run after the next render. The virtual dom stores a list of those tasks to send a signal to them when the next render is done.
|
||||
@@ -45,6 +50,7 @@ impl Runtime {
|
||||
scope_stack: Default::default(),
|
||||
current_task: Default::default(),
|
||||
tasks: Default::default(),
|
||||
suspended_tasks: Default::default(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user