pub fn sigint_or_sigterm() -> Result<(Shutdown, Watch), RegisterError>
This is supported on crate feature shutdown only.
Expand description

Creates a shutdown channel

Shutdown watches for SIGINT and SIGTERM signals. When a signal is received, Watch instances are notifed and, when all watches are dropped, the shutdown is completed. If a second signal is received while waiting for watches to be dropped, the shutdown is aborted.

If a second signal is received while waiting for shutdown to complete, the process