wip: work on scheduler, async, coroutines, and merge scope into context

This commit is contained in:
Jonathan Kelley committed 2021-11-03 19:55:02 -04:00
1 parent 1e6e5e611b
commit b56ea6c9a9
11 files changed
+420 -442

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
//! Coroutines are just a "futures unordered" buffer for tasks that can be submitted through the use_coroutine hook.
//!
//! The idea here is to move *coroutine* support as a layer on top of *tasks*
use futures_util::{stream::FuturesUnordered, Future};
pub struct CoroutineScheduler {
futures: FuturesUnordered<Box<dyn Future<Output = ()>>>,
}
impl CoroutineScheduler {
pub fn new() -> Self {
CoroutineScheduler {
futures: FuturesUnordered::new(),
}
}
}