Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint: Structured Async

โญโญโญ advancedโณ 30 min read๐Ÿ“ Lesson 129 of 169

Per-job timeouts inside a TaskGroup โ€” with a CancelledError-swallowing probe.

Checkpoint โ€” hardened fan-out

Combine the module: async def fetch_all(jobs) runs zero-arg async jobs under a per-job timeout of 0.05s inside ONE TaskGroup:

  • success โ†’ (index, value) in that slot
  • job exceeding 0.05s โ†’ (index, 'timeout:0.05')
  • a job raising a REAL error โ†’ fetch_all still raises (only timeouts are converted)

The wrong-probe implements this with a blanket except BaseException โ€” which also eats CancelledError and masks real errors. Your cleanup discipline is the graded skill.