loop and tell it to stop?
It looks like this:
fn sync_task() {
loop {};
}
async handler(stop: Option<bool>) {
if stop: stop_sync_task();
else: tokio::spawn_blocking(sync_task);
}
Update: I have idea,
block_spawn function which uses std::Mutex
I thisnk exists something like async_block i don’t remember well
Обсуждают сегодня