mirror of
https://github.com/actix/examples
synced 2025-06-27 01:27:43 +02:00
improve actorless echo example
This commit is contained in:
@ -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