We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e20b0f0 commit d6455abCopy full SHA for d6455ab
src/rt/mod.rs
@@ -12,7 +12,11 @@ pub struct Runtime {}
12
/// The global runtime.
13
pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
14
// Create an executor thread pool.
15
- let num_threads = num_cpus::get().max(1);
+ let num_threads = std::env::var("ASYNC_STD_RT_THREADS")
16
+ .map(|env| env.parse().expect("ASYNC_STD_RT_THREADS must be a number"))
17
+ .unwrap_or_else(|_| num_cpus::get())
18
+ .max(1);
19
+
20
for _ in 0..num_threads {
21
thread::Builder::new()
22
.name("async-std/runtime".to_string())
0 commit comments