Practice · 2 of 2
Bounded Waits
CHALLENGE
Difficulty: intermediate+25 XP
Implement async def with_deadline(coro, seconds) awaiting asyncio.wait_for(coro, timeout=seconds) and returning ('ok', result) on success or ('timeout', None) on asyncio.TimeoutError. Provide sync wrapper run_deadline(coro, seconds).
Press Submit to check your solution.
Back to lesson: Practice: gather and Timeout Drills