MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / subscribe

Method subscribe

nodedb/src/control/shutdown/watch.rs:42–44  ·  view source on GitHub ↗

Subscribe a new receiver. Always reflects the current state — a receiver created after [`signal`] has been called observes the signal on its first poll of `wait_cancelled`, so there is no "signal arrived before I subscribed" race. [`signal`]: Self::signal

(&self)

Source from the content-addressed store, hash-verified

40 ///
41 /// [`signal`]: Self::signal
42 pub fn subscribe(&self) -> ShutdownReceiver {
43 ShutdownReceiver::from_watch(self.tx.subscribe())
44 }
45
46 /// Flip the shutdown flag. Idempotent — calling twice is a
47 /// no-op, and the second call does NOT wake subscribers

Calls

no outgoing calls

Tested by

no test coverage detected