Skip to main content

install_ctrlc

Function install_ctrlc 

Source
pub fn install_ctrlc(token: CancellationToken) -> JoinHandle<()>
Expand description

Spawn a tokio task that listens for SIGINT (Ctrl-C) and flips the token. Returns a handle; aborting the handle is sufficient cleanup since the runtime tears down on process exit.

On second Ctrl-C, the task force-exits with code 130 — same UX as the legacy executor.