Skip to main content

Practice · 1 of 1

Timeout-bounded job runner

CHALLENGE
Difficulty: advanced+25 XP

Implement async def with_timeout(job, seconds): - run the zero-arg async callable job under asyncio.timeout(seconds) - return the job's value when it finishes in time - return exactly the string f'timeout:{seconds}' when it exceeds the budget

Back to lesson: Practice: Timeout Practice