~/talk

If an asyncio Task fails in the woods and nobody is around to see it, does i....

Talkat PyCon US 2022 · 2022-04-27..05-03· [python, testing]
slides:none on file

Production asyncio code at a large site with hundreds of backend services yields concrete mistakes: asyncio.run is the right bootstrap, nested event loops (you paused the caller’s loop and made a new one) causes expired timeouts and strange tracebacks, and anonymous tasks silently print exceptions until a 3am pager. Use async context managers, exit stacks or a nursery/watcher (the later package) to manage lifetimes, obey cancellation (re-raise CancelledError after cleanup), and add timeouts around awaited operations.

AI-written summary · about

  1. 0:00Start
  2. 2:16You want to use some asyncio from an existing blocking function.
  3. 6:53What is bootstrapping
  4. 7:12It is important to have clean async bootstrapping
  5. 8:55Set it and forget it
  6. 9:48Solution: The nursery from trio
  7. 11:14Terrible Tradeoffs
  8. 12:33calling coroutines from a class _init_
  9. 14:26The better pattern
  10. 15:08You need signal handling
  11. 15:23Terrible Signal Handling Example
  12. 18:39How does Cancellation work?
  13. 19:42Cancellation is a Contract
  14. 23:42You need to use timeouts.
  15. 23:57chance an asyne call doesn't complete
  16. 27:36Questions?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.