Grokking Concurrency in Python
0% completed
Nurseries, Cancel Scopes and AnyIO
A store step in Harvest catches its own cancellation and tries a second write. Run as an asyncio task and cancelled at 0.30 seconds, it finishes that second write at 0.50 seconds. The same function, inside an anyio cancel scope that expires at 0.30 seconds, never finishes the second write. The code is identical; only the way each library delivers a cancellation differs.
Trio and Its Nurseries
Trio is an async library for Python, separate from asyncio, with its own event loop, and it was built around structured concurrency from the start. **A nursery is trio's name for a task group: an
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%