Похожие чаты

How can I send signal from asysnc code into sync

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

1 ответов

13 просмотров

I thisnk exists something like async_block i don’t remember well

Похожие вопросы

Карта сайта