Function create_shutdown

Source
pub fn create_shutdown() -> (ShutdownSender, ShutdownReceiver)
Expand description

Create a linked ShutdownSender and ShutdownReceiver pair. The receiver’s watch method will not return until the ShutdownSender’s shutdown method is called.

The ShutdownReceiver can (and should) be cloned and reused across many async tasks.