Skip to main content

spawn

Function spawn 

Source
pub fn spawn(tx: UnboundedSender<InputEvent>) -> ReaderHandle
Expand description

Spawn a blocking OS thread that reads crossterm events and forwards them over tx. Returns a ReaderHandle for lifecycle control (Pause / Resume / Shutdown). The thread exits when:

  • the ReaderHandle is dropped (Shutdown sent),
  • tx is closed (send returns Err),
  • or a fatal crossterm read error fires.