Spawn `num_workers` worker processes. Each gets the same token; the token is generated once per pool.
(num_workers: usize, project_root: PathBuf)
| 196 | /// Spawn `num_workers` worker processes. Each gets the same token; the |
| 197 | /// token is generated once per pool. |
| 198 | pub fn new(num_workers: usize, project_root: PathBuf) -> io::Result<Self> { |
| 199 | let self_path = std::env::current_exe()?; |
| 200 | let token = generate_token()?; |
| 201 | let mut workers = Vec::with_capacity(num_workers); |
| 202 | for _ in 0..num_workers { |
| 203 | workers.push(spawn_worker(&self_path, &token)?); |
| 204 | } |
| 205 | Ok(Self { |
| 206 | workers, |
| 207 | self_path, |
| 208 | project_root, |
| 209 | token, |
| 210 | }) |
| 211 | } |
| 212 | |
| 213 | /// Process every entry in `files`, calling `on_progress(n, total, path)` |
| 214 | /// once per file. Returns one tuple per successfully-processed file; |
nothing calls this directly
no test coverage detected