#thread-pool #job #run

bin+lib job-pool

Thread Pool

4 releases

0.1.3 May 14, 2024
0.1.2 May 13, 2024
0.1.1 May 13, 2024
0.1.0 May 13, 2024

#37 in #thread-pool

Download history 284/week @ 2024-05-12 41/week @ 2024-05-19 3/week @ 2024-05-26

328 downloads per month
Used in http-srv

MIT license

10KB
230 lines

Thread Pool

This is a Thread Pool library for rust.


lib.rs:

Thread Pool

This crate contains code to run a Job pool.

Example

use job_pool::*;
use std::thread;
use std::time::Duration;

let conf = PoolConfig::default();
let pool = ThreadPool::new(conf).unwrap();
for _ in 0..10 {
    pool.execute(|| {
        thread::sleep(Duration::from_secs(5));
    });
}
pool.join();

No runtime deps