Allow thread pool size configuration
This commit is contained in:
parent
8fd751304c
commit
5b975a23f8
@ -62,7 +62,11 @@ fn start_server(
|
||||
eprintln!("Strated server!");
|
||||
|
||||
let context: Arc<Mutex<Context>> = Arc::default();
|
||||
let mut pool = ThreadPool::new(4);
|
||||
|
||||
let thread_pool_size = std::env::var("THREAD_POOL")
|
||||
.map(|s| s.parse().unwrap_or(4))
|
||||
.unwrap_or(4);
|
||||
let mut pool = ThreadPool::new(thread_pool_size);
|
||||
|
||||
for stream in listener.incoming() {
|
||||
eprintln!("New connection!");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user