python
8 minPython TaskGroups: make sibling failure and cleanup part of the design
Understand structured task lifetimes, cancellation, and grouped failures in asyncio.
Loading page...
python
8 minUnderstand structured task lifetimes, cancellation, and grouped failures in asyncio.
Q&A
Q&AIt cancels unfinished siblings, waits for cleanup, and surfaces failures as a group.
Child cancellation is cooperative, so cleanup must run and cancellation should normally be re-raised. A task group scopes lifetimes; it does not roll back remote effects or make partial success a business policy.
Q&A
Q&AWHERE filters input rows before grouping; HAVING filters groups after aggregation.
Use WHERE to remove rows before GROUP BY, such as excluding inactive employees. Use HAVING to filter aggregate results, such as departments with COUNT(*) greater than five. Moving a condition between them can change both meaning and query work.
python
17 minUnderstand event-loop scheduling, CPU versus I/O concurrency, ASGI worker lifecycles, per-request sessions, and cancellation-safe background work.