mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
net/p2p: Expose the dnet subscriber through a function.
This commit is contained in:
@@ -320,9 +320,11 @@ impl P2p {
|
||||
}
|
||||
|
||||
/// Return a reference to the dnet subscriber
|
||||
pub async fn dnet_subscribe(&self) -> Subscription<DnetEvent> {
|
||||
self.dnet_sub.clone().subscribe().await
|
||||
pub fn dnet_sub(&self) -> SubscriberPtr<DnetEvent> {
|
||||
self.dnet_sub.clone()
|
||||
}
|
||||
|
||||
/// Send a dnet notification over the subscriber
|
||||
pub async fn dnet_notify(&self, event: DnetEvent) {
|
||||
self.dnet_sub.notify(event).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user