I want to a command to produce a message 200ms after launching it.
Currently, i’m doing it like this:
Command::perform(
async {
std::thread::sleep(Duration::from_millis(200))
},
|_| Message::AferSomeTime,
)
But, correct me if I’m wrong, I think this block the thread running all commands. And i also think this is the cause of this warning I’m having:
[WARN iced_futures::subscription::tracker] Error sending event to subscription: TrySendError { kind: Full }
I tried to use tokio instead:
tokio::time::sleep(Duration::from_millis(200)).await;
But i get an error at runtime:
thread 'smol-1' panicked at ui\src\lib.rs:112:21:
there is no reactor running, must be called from the context of a Tokio 1.x runtime