cuprated/config/tokio.rs
1use serde::{Deserialize, Serialize};
2
3use super::macros::config_struct;
4
5config_struct! {
6 /// [`tokio`] config.
7 #[derive(Debug, Deserialize, Serialize, Eq, PartialEq)]
8 #[serde(deny_unknown_fields, default)]
9 pub struct TokioConfig {
10 #[comment_out = true]
11 /// The amount of threads to spawn for the tokio thread-pool.
12 ///
13 /// Type | Number
14 /// Valid values | >= 1
15 /// Examples | 1, 8, 14
16 pub threads: usize,
17 }
18}
19
20impl Default for TokioConfig {
21 fn default() -> Self {
22 Self {
23 threads: cuprate_helper::thread::threads_75().get(),
24 }
25 }
26}