wire-framework 0.1.0

A DI library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
use tokio::sync::watch;

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