feat: more suspended nodes!

This commit is contained in:
Jonathan Kelley committed 2021-07-14 23:18:02 -04:00
1 parent c52af221f7
commit de9f61bcf4
20 files changed
+644 -148

No files matched your search

+12 -19
View File
@@ -21,25 +21,18 @@ const ENDPOINT: &str = "https://dog.ceo/api/breeds/image/random";
static App: FC<()> = |cx| {
let mut count = use_state(cx, || 0);
let mut fut = cx.use_hook(
move || {
Box::pin(async {
//
let mut tick = 0;
loop {
async_std::task::sleep(Duration::from_millis(250)).await;
log::debug!("ticking forward... {}", tick);
tick += 1;
// match surf::get(ENDPOINT).recv_json::<DogApi>().await {
// Ok(_) => (),
// Err(_) => (),
// }
}
}) as Pin<Box<dyn Future<Output = ()> + 'static>>
},
|h| h,
|_| {},
);
let mut fut = Box::pin(async {
let mut tick: i32 = 0;
loop {
async_std::task::sleep(Duration::from_millis(250)).await;
log::debug!("ticking forward... {}", tick);
tick += 1;
// match surf::get(ENDPOINT).recv_json::<DogApi>().await {
// Ok(_) => (),
// Err(_) => (),
// }
}
});
cx.submit_task(fut);