Skip to main content

install_spawner

Function install_spawner 

Source
pub fn install_spawner(
    spawn: impl Fn(Pin<Box<dyn Future<Output = ()>>>) -> Box<dyn FnOnce()> + 'static,
)
Expand description

Install the async-spawn door: spawn runs a future on the app’s main-loop executor and returns an ABORT closure (remove + drop the future). The abort MUST be a no-op once the task has completed — Resource stores it after an eager first poll, so a synchronously ready future has already finished by then. day-core’s launch_with wires this to day::task / TaskHandle::abort; call it once at startup (docs/async.md).

Day API ↩ Guides· daybrite.dev