pub fn signal(kind: SignalKind) -> Result<Signal>
Creates a new listener which will receive notifications when the current
process receives the specified signal
This function will create a new stream which binds to the default reactor.
Signal stream is an infinite stream which will receive
notifications whenever a signal is received. More documentation can be
Signal itself, but to reiterate:
- Signals may be coalesced beyond what the kernel already does.
- Once a signal handler is registered with the process the underlying libc signal handler is never unregistered.
Signal stream can be created for a particular signal number
multiple times. When a signal is received then all the associated
channels will receive the signal notification.
- If the lower-level C functions fail for some reason.
- If the previous initialization of this specific signal failed.
- If the signal is one of
This function panics if there is no current reactor set, or if the
feature flag is not enabled.