Skip to main content

task

Function task 

Source
pub fn task(fut: impl Future<Output = ()> + 'static) -> TaskHandle
Expand description

Spawn an async flow onto Day’s main-loop executor. This is the opt-in entry point for actions that open modals or pickers: button.action(|| day::task(async move { … .await … })). The future is polled once before this returns; the returned handle can TaskHandle::abort it and is freely discardable. At app termination pending tasks are dropped while reactive state is still available. Tasks submitted after shutdown begins are dropped without being polled.