Try to wrap your async function in ic_cdk::spawn()
, i.e.:
async async_fn() {
call().await;
...
}
let _id = timer::set_timer(..., || ic_cdk::spawn(async_fn()));
Try to wrap your async function in ic_cdk::spawn()
, i.e.:
async async_fn() {
call().await;
...
}
let _id = timer::set_timer(..., || ic_cdk::spawn(async_fn()));
Try to wrap your async function in
ic_cdk::spawn()
, i.e.:async async_fn() { call().await; ... } let _id = timer::set_timer(..., || ic_cdk::spawn(async_fn()));
Awesome, it works, thanks. 🙏
Timers API: async function execution #351
Is there a case to make callables async functions provided to timers? If so, can you please show example? For now, for me, it's just ignoring everything in the callable function for the timer that is async.