Use external event sender

This commit is contained in:
Joscha 2022-03-03 00:34:54 +01:00
parent b6c58b8a2b
commit dfb5ade023

View file

@ -383,8 +383,8 @@ pub async fn new(
url: String, url: String,
room: String, room: String,
timeout: Duration, timeout: Duration,
) -> (Arc<Mutex<CoveConn>>, CoveConnMt, UnboundedReceiver<Event>) { ev_tx: UnboundedSender<Event>,
let (ev_tx, ev_rx) = mpsc::unbounded_channel(); ) -> (Arc<Mutex<CoveConn>>, CoveConnMt) {
let conn = Arc::new(Mutex::new(CoveConn { let conn = Arc::new(Mutex::new(CoveConn {
state: State::Connecting, state: State::Connecting,
ev_tx: ev_tx.clone(), ev_tx: ev_tx.clone(),
@ -396,5 +396,5 @@ pub async fn new(
conn, conn,
ev_tx, ev_tx,
}; };
(mt.conn.clone(), mt, ev_rx) (mt.conn.clone(), mt)
} }