You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce the `Monitor` struct to track relay status changes via channel notifications.
Closes#850
Pull-Request: #851
Signed-off-by: Yuki Kishimoto <[email protected]>
/// Create a new monitor with the given channel size
32
+
///
33
+
/// # Panics
34
+
///
35
+
/// This will panic if the channel size is equal to `0` or larger than `usize::MAX / 2`;
36
+
pubfnnew(channel_size:usize) -> Self{
37
+
let(tx, ..) = broadcast::channel(channel_size);
38
+
39
+
Self{channel: tx }
40
+
}
41
+
42
+
/// Subscribe to monitor notifications
43
+
///
44
+
/// <div class="warning">When you call this method, you subscribe to the notifications channel from that precise moment. Anything received by relay/s before that moment is not included in the channel!</div>
0 commit comments