[][src]Function chan_signal::notify_on

pub fn notify_on(chan: &Sender<Signal>, signal: Signal)

Subscribe to a signal on a channel.

When signal is delivered to this process, it will be sent on the channel given.

Note that a signal is sent using a non-blocking send. Namely, if the channel's buffer is full (or it has no buffer) and it isn't ready to rendezvous, then the signal will be dropped.

There is currently no way to unsubscribe. Moreover, the channel given here will be alive for the lifetime of the process. Therefore, the channel will never be closed.

THIS MUST BE CALLED BEFORE ANY OTHER THREADS ARE SPAWNED IN YOUR PROCESS.