Skip to main content

Practice ยท 1 of 1

run_jobs with retries

Implement run_jobs(jobs, workers=3, retries=2) where jobs is a list of zero-arg callables: - execute jobs concurrently on a ThreadPoolExecutor(max_workers=workers) - a job that raises gets retried, up to retries additional attempts - return {'succeeded': {index: value}, 'failed': [sorted indices]} - failed jobs are those whose FINAL attempt still raised Deterministic grading: the test uses closure-counted flaky jobs (fail once, then succeed) so no timing assumptions are needed.

Difficulty: advanced

Back to lesson: Practice: Project: Concurrent Job Processor