thrdpool

Crates.iothrdpool
lib.rsthrdpool
version0.1.0
sourcesrc
created_at2022-10-18 02:13:26.203673
updated_at2022-10-18 02:13:26.203673
descriptionCreates a threadpool to run multiple jobs in parallel
homepage
repositoryhttps://github.com/matteac/thrdpool
max_upload_size
id690566
size2,686
Mateo Acuña (matteac)

documentation

README

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!");
        })
    }
Commit count: 3

cargo fmt