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

Method execute

src/server/worker_pool.rs:179–197  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

177
178 impl AsyncJob for TestJob {
179 async fn execute(self) -> Result<JobResult, JobError> {
180 sleep(Duration::from_millis(self.duration_ms)).await;
181
182 if self.should_fail {
183 Err(JobError::from(format!(
184 "Job {} failed as requested",
185 self.id
186 )))
187 } else {
188 Ok(JobResult {
189 job_id: self.id.clone(),
190 success: true,
191 message: Some(format!(
192 "Job {} completed after {}ms",
193 self.id, self.duration_ms
194 )),
195 })
196 }
197 }
198
199 fn job_id(&self) -> String {
200 self.id.clone()

Callers 1

try_submitMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected