|
|
@@ -2,6 +2,7 @@ use async_std::sync::Mutex;
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
use fxhash::FxHashMap;
|
|
|
+use log::warn;
|
|
|
use rand::Rng;
|
|
|
|
|
|
pub type SubscriberPtr<T> = Arc<Subscriber<T>>;
|
|
|
@@ -70,18 +71,18 @@ impl<T: Clone> Subscriber<T> {
|
|
|
match sub.send(message_result.clone()).await {
|
|
|
Ok(()) => {}
|
|
|
Err(err) => {
|
|
|
- panic!("Error returned sending message in notify() call! {}", err);
|
|
|
+ warn!("Error returned sending message in notify() call! {}", err);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- pub async fn notify_with_id(&self, message_result: T, id: u64) {
|
|
|
+ pub async fn notify_by_id(&self, message_result: T, id: u64) {
|
|
|
if let Some(sub) = (*self.subs.lock().await).get(&id) {
|
|
|
match sub.send(message_result.clone()).await {
|
|
|
Ok(()) => {}
|
|
|
Err(err) => {
|
|
|
- panic!("Error returned sending message in notify() call! {}", err);
|
|
|
+ warn!("Error returned sending message in notify_by_id() call! {}", err);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -95,7 +96,7 @@ impl<T: Clone> Subscriber<T> {
|
|
|
match sub.send(message_result.clone()).await {
|
|
|
Ok(()) => {}
|
|
|
Err(err) => {
|
|
|
- panic!("Error returned sending message in notify_with_exclude() call! {}", err);
|
|
|
+ warn!("Error returned sending message in notify_with_exclude() call! {}", err);
|
|
|
}
|
|
|
}
|
|
|
}
|