mirror of
https://github.com/actix/examples
synced 2025-03-26 05:03:16 +01:00
33 lines
548 B
Rust
33 lines
548 B
Rust
use tokio::sync::{mpsc, oneshot};
|
|
|
|
use crate::{ConnId, Msg, RoomId};
|
|
|
|
#[derive(Debug)]
|
|
pub enum Command {
|
|
Connect {
|
|
conn_tx: mpsc::UnboundedSender<Msg>,
|
|
res_tx: oneshot::Sender<ConnId>,
|
|
},
|
|
|
|
Disconnect {
|
|
conn: ConnId,
|
|
},
|
|
|
|
List {
|
|
res_tx: oneshot::Sender<Vec<RoomId>>,
|
|
},
|
|
|
|
Join {
|
|
conn: ConnId,
|
|
room: RoomId,
|
|
res_tx: oneshot::Sender<()>,
|
|
},
|
|
|
|
Message {
|
|
room: RoomId,
|
|
msg: Msg,
|
|
skip: ConnId,
|
|
res_tx: oneshot::Sender<()>,
|
|
},
|
|
}
|