nio-threadpool

Crates.ionio-threadpool
lib.rsnio-threadpool
version0.1.0
created_at2026-01-24 18:38:52.695445+00
updated_at2026-01-24 18:38:52.695445+00
descriptiongeneral purpose threadpool implementation
homepage
repositoryhttps://github.com/nurmohammed840/nio
max_upload_size
id2067202
size7,140
Nur (nurmohammed840)

documentation

README

Example

use nio_threadpool::{Runnable, ThreadPool};
use std::{thread, time::Duration};

struct Task {}

impl Runnable for Task {
    fn run(self) {
        println!("{:#?}", thread::current());
    }
}

#[test]
fn example() {
    let pool = ThreadPool::new()
        .max_threads_limit(2)
        .timeout(Some(Duration::from_secs(3)))
        .stack_size(512)
        .name(|id| format!("Worker-{id}"));

    pool.execute(Task {});
    pool.execute(Task {});
    pool.execute(Task {});
}
Commit count: 166

cargo fmt