add multithreadalt try 2

This commit is contained in:
Toshit Chawda 2024-10-03 08:47:20 -07:00
parent 74a77e247c
commit 4c19b207bf
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
2 changed files with 6 additions and 0 deletions

View file

@ -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);

View file

@ -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();