MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / new

Method new

src/extraction_worker.rs:198–211  ·  view source on GitHub ↗

Spawn `num_workers` worker processes. Each gets the same token; the token is generated once per pool.

(num_workers: usize, project_root: PathBuf)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 3

generate_tokenFunction · 0.85
spawn_workerFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected