#thread-pool #jobs #create #parallel #run #multiple #connection

thrdpool

Creates a threadpool to run multiple jobs in parallel

1 unstable release

0.1.0 Oct 18, 2022

#75 in #jobs

MIT/Apache

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!");
        })
    }

No runtime deps