You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
465 B
23 lines
465 B
4 years ago
|
//! Pub-sub traits
|
||
|
use super::*;
|
||
|
use std::any::TypeId;
|
||
|
use std::collections::HashMap;
|
||
|
use std::sync::Arc;
|
||
|
use tokio::sync::{
|
||
|
RwLock,
|
||
|
mpsc,
|
||
|
};
|
||
|
|
||
|
use message::Message;
|
||
|
|
||
|
#[derive(Debug)]
|
||
|
struct SubListInner
|
||
|
{
|
||
|
//TODO: how tf do we do this?
|
||
|
//subs: RwLock<HashMap<TypeID, RwLock<Vec<mpsc::Sender<message::SerializedMessage<dyn message::MessageValue>>>>>>,
|
||
|
}
|
||
|
|
||
|
/// List of subscibers
|
||
|
#[derive(Debug, Clone)]
|
||
|
pub struct SubscriberListRef(Arc<SubListInner>);
|