From 4c19b207bfd789047854d8a1b8b9c7523aeddded Mon Sep 17 00:00:00 2001 From: Toshit Chawda Date: Thu, 3 Oct 2024 08:47:20 -0700 Subject: [PATCH] add multithreadalt try 2 --- server/src/config.rs | 3 +++ server/src/main.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/server/src/config.rs b/server/src/config.rs index 1145c51..dc8dfa9 100644 --- a/server/src/config.rs +++ b/server/src/config.rs @@ -67,6 +67,9 @@ pub enum RuntimeFlavor { /// Multi-threaded tokio runtime. #[default] MultiThread, + /// Alternate multi-threaded tokio runtime. + #[cfg(tokio_unstable)] + MultiThreadAlt, } pub type BindAddr = (SocketType, String); diff --git a/server/src/main.rs b/server/src/main.rs index 9076636..8a75189 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,5 +1,6 @@ #![feature(ip)] #![deny(clippy::todo)] +#![allow(unexpected_cfgs)] use std::{fs::read_to_string, net::IpAddr}; @@ -112,6 +113,8 @@ fn main() -> anyhow::Result<()> { let mut builder: runtime::Builder = match CONFIG.server.runtime { RuntimeFlavor::SingleThread => runtime::Builder::new_current_thread(), RuntimeFlavor::MultiThread => runtime::Builder::new_multi_thread(), + #[cfg(tokio_unstable)] + RuntimeFlavor::MultiThreadAlt => runtime::Builder::new_multi_thread_alt(), }; builder.enable_all();