{"id":20226041,"url":"https://github.com/darshanparajuli/jobpool","last_synced_at":"2025-04-10T17:06:14.474Z","repository":{"id":57634624,"uuid":"104955942","full_name":"darshanparajuli/jobpool","owner":"darshanparajuli","description":"A simple and lightweight threadpool library for Rust.","archived":false,"fork":false,"pushed_at":"2020-03-16T04:06:58.000Z","size":67,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T14:46:28.262Z","etag":null,"topics":["concurrency","rust","rust-library","threading","threadpool"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darshanparajuli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-27T01:21:07.000Z","updated_at":"2020-10-06T07:16:42.000Z","dependencies_parsed_at":"2022-09-26T20:20:39.175Z","dependency_job_id":null,"html_url":"https://github.com/darshanparajuli/jobpool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshanparajuli%2Fjobpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshanparajuli%2Fjobpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshanparajuli%2Fjobpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshanparajuli%2Fjobpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darshanparajuli","download_url":"https://codeload.github.com/darshanparajuli/jobpool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878015,"owners_count":21011158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concurrency","rust","rust-library","threading","threadpool"],"created_at":"2024-11-14T07:15:54.813Z","updated_at":"2025-04-10T17:06:14.449Z","avatar_url":"https://github.com/darshanparajuli.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JobPool\n\nA simple and lightweight threadpool implementation for Rust.\n\n[![Build Status](https://travis-ci.org/darshanparajuli/jobpool.svg?branch=master)](https://travis-ci.org/darshanparajuli/jobpool)\n\n## Example\n```rust\nextern crate jobpool;\n\nuse jobpool::JobPool;\nuse std::thread;\nuse std::time::Duration;\nuse std::sync::mpsc;\n\nfn main() {\n    let pool_size = 8; // or number of cpu cores\n    let mut pool = JobPool::new(pool_size);\n    // pool.auto_grow(100);\n\n    let (tx, rx) = mpsc::channel();\n\n    for i in 0..100 {\n        let tx = tx.clone();\n        pool.queue(move || {\n            // Do some work, following is just for example's sake\n            thread::sleep(Duration::from_millis(100));\n            println!(\"sending: {}\", i);\n            tx.send(i).unwrap();\n        });\n        // or pool.queue_with_priority(move || {...}, priority_val);\n    }\n\n    for _ in 0..100 {\n        match rx.recv() {\n            Ok(val) =\u003e println!(\"received: {}\", val),\n            Err(e) =\u003e eprintln!(\"Error: {}\", e),\n        }\n    }\n\n    // Explicit call to shutdown; JobPool shuts down automatically after\n    // going out of scope as well.\n    pool.shutdown();\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarshanparajuli%2Fjobpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarshanparajuli%2Fjobpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarshanparajuli%2Fjobpool/lists"}