Skip to main content

wire_framework/service/
stop_receiver.rs

1use tokio::sync::watch;
2
3/// Represents a receiver for the stop signal.
4/// This signal is sent when the node is shutting down.
5/// Every task is expected to listen to this signal and stop its execution when it is received.
6///
7/// This structure exists as a first-class entity instead of being a resource to make it more visible
8/// and prevent tasks from hanging by accident.
9#[derive(Debug, Clone)]
10pub struct StopReceiver(pub watch::Receiver<bool>);