MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / poll_completed

Method poll_completed

src/server/worker_pool.rs:128–141  ·  view source on GitHub ↗

Clean up completed jobs from the internal tracking Returns the results of any completed jobs.

(&self)

Source from the content-addressed store, hash-verified

126 ///
127 /// Returns the results of any completed jobs.
128 pub async fn poll_completed(&self) -> Vec<Result<JobResult, JobError>> {
129 let mut results = Vec::new();
130 let mut jobs = self.active_jobs.lock().await;
131
132 // Collect completed jobs
133 while let Some(result) = jobs.try_join_next() {
134 match result {
135 Ok(job_result) => results.push(job_result),
136 Err(e) => results.push(Err(JobError::from(format!("Job panicked: {}", e)))),
137 }
138 }
139
140 results
141 }
142
143 /// Shutdown the worker pool
144 ///

Calls

no outgoing calls