hj_thread_pool 0.1.1

A simple thread pool implementation in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use hj_thread_pool::{HjThreadPoolCfg, HjThreadPool, HjThreadPoolLogLevel};

fn main() {
    let pool = HjThreadPool::new(HjThreadPoolCfg {
        num_workers: 2,
        log_level: HjThreadPoolLogLevel::Debug,
    });
    pool.execute(|| {
        for i in 0..10 {
            println!("Task 1: {}", i);
            std::thread::sleep(std::time::Duration::from_secs(1));
        }
    });
}