mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
improve actorless echo example
This commit is contained in:
@ -11,7 +11,7 @@ awc = "3"
|
||||
|
||||
derive_more = "0.99.5"
|
||||
env_logger = "0.9"
|
||||
futures-util = { version = "0.3.7", default-features = false, features = ["std", "sink"] }
|
||||
futures-util = { version = "0.3.17", default-features = false, features = ["std", "sink"] }
|
||||
log = "0.4"
|
||||
rand = "0.8"
|
||||
tokio = { version = "1.13.1", features = ["full"] }
|
||||
tokio = { version = "1.13.1", features = ["rt", "macros", "sync", "time"] }
|
||||
|
@ -42,7 +42,8 @@ async fn chat_ws(
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
// note that the `actix` based WebSocket handling would NOT work under `tokio::main`
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
|
@ -9,7 +9,7 @@ use std::{
|
||||
};
|
||||
|
||||
use rand::{thread_rng, Rng as _};
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::{Command, ConnId, Msg, RoomId};
|
||||
|
||||
|
Reference in New Issue
Block a user