fn add_producer(&self, conn_uuid: u128, sender: ChatSender) {
        let conn_id: usize = conn_uuid.try_into().unwrap();
        let mut mutable = self.mutable.lock();
        for v in mutable.consumers.values() {
            send_cmd(v, ChatCmd::AddSink(conn_uuid, sender.clone()));
        }
        send_cmd(
            &sender,
            ChatCmd::AddSink(conn_uuid, self.my_sender.lock().as_ref().unwrap().clone()),
        );
        mutable.producers.insert(conn_uuid, sender);
        if !mutable.names.contains_key(&conn_uuid) {
            if let Some(welcome) = self.kv.get(&"name_prompt".to_string()) {
                send_cmd(&self.net_sender, NetCmd::SendBytes(conn_id, welcome.as_bytes().to_vec()));
            }
        }
    }
// all consumers are told about a new producer and the producer
// it told to add the coordinator as a sink
// lastly, a prompt for name is sent out
all consumers are told about a new producer and the producer
it told to add the coordinator as a sink
lastly, a prompt for name is sent out
all consumers are told about a new producer and the producer it told to add the coordinator as a sink lastly a prompt for name is sent out
fn add_producer(&self, conn_uuid: u128, sender: ChatSender) {
        let conn_id: usize = conn_uuid.try_into().unwrap();
        let mut mutable = self.mutable.lock();
        for v in mutable.consumers.values() {
            send_cmd(v, ChatCmd::AddSink(conn_uuid, sender.clone()));
        }
        send_cmd(
            &sender,
            ChatCmd::AddSink(conn_uuid, self.my_sender.lock().as_ref().unwrap().clone()),
        );
        mutable.producers.insert(conn_uuid, sender);
        if !mutable.names.contains_key(&conn_uuid) {
            if let Some(welcome) = self.kv.get(&"name_prompt".to_string()) {
                send_cmd(&self.net_sender, NetCmd::SendBytes(conn_id, welcome.as_bytes().to_vec()));
            }
        }
    }
fn add_producer ( & self , conn_uuid : u128 , sender : ChatSender ) { let conn_id : usize = conn_uuid . try_into ( ) . unwrap ( ) ; let mut mutable = self . mutable . lock ( ) ; for v in mutable . consumers . values ( ) { send_cmd ( v , ChatCmd :: AddSink ( conn_uuid , sender . clone ( ) ) ) ; } send_cmd ( & sender , ChatCmd :: AddSink ( conn_uuid , self . my_sender . lock ( ) . as_ref ( ) . unwrap ( ) . clone ( ) ) , ) ; mutable . producers . insert ( conn_uuid , sender ) ; if ! mutable . names . contains_key ( & conn_uuid ) { if let Some ( welcome ) = self . kv . get ( & " " . to_string ( ) ) { send_cmd ( & self . net_sender , NetCmd :: SendBytes ( conn_id , welcome . as_bytes ( ) . to_vec ( ) ) ) ; } } }
all consumers are told about a new producer and the producer
it told to add the coordinator as a sink
lastly, a prompt for name is sent out
all consumers are told about a new producer and the producer it told to add the coordinator as a sink lastly a prompt for name is sent out
&self
conn_uuid
u128
sender
ChatSender