1 unstable release
0.1.0 | Oct 18, 2022 |
---|
#65 in #jobs
3KB
ThreadPool
A simple package to run multiple jobs in a threadpool
// you can handle 4 connections !!!!!!
let pool = ThreadPool::new(4);
for stream in listener.incoming() {
let stream = stream.unwrap();
pool.execute(|| {
handle_connection(stream);
println!("Connection handled!");
})
}