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

+2 -2
View File
@@ -32,13 +32,13 @@ static App: FC<()> = |(cx, props)| {
let p2 = use_state(cx, || 0);
let (mut p1_async, mut p2_async) = (p1.for_async(), p2.for_async());
let (p1_handle, _) = use_task(cx, || async move {
let (p1_handle, _) = use_coroutine(cx, || async move {
loop {
*p1_async.get_mut() += 1;
async_std::task::sleep(std::time::Duration::from_millis(75)).await;
}
});
let (p2_handle, _) = use_task(cx, || async move {
let (p2_handle, _) = use_coroutine(cx, || async move {
loop {
*p2_async.get_mut() += 1;
async_std::task::sleep(std::time::Duration::from_millis(100)).await;