~/talk

Practical usage of asyncio

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [python, concurrency]
name:Sim Zacks
links:none on file
slides:none on file

Explains practical asyncio usage: async/await coroutines, creating tasks with loop.create_task and waiting with asyncio.wait/run_until_complete, and why asyncio.sleep vs time.sleep matters (time.sleep blocks, asyncio raises await errors). Builds an aiohttp web scraper that counts occurrences of "the" across blogs, shows results arrive out of order and demonstrates per-task error handling for a mangled URL. Shows offloading blocking logging via run_in_executor to keep the event loop responsive and simplify debugging in a single process.

AI-written summary · about

  1. 0:00Introduction to asyncio
  2. 2:04Traditional concurrency methods
  3. 4:13Event loop fundamentals
  4. 6:00Writing coroutines
  5. 9:58Non-blocking sleep demo
  6. 12:48Web scraping with aiohttp
  7. 17:47Handling async results
  8. 19:33Async logging solution
  9. 21:58Q&A and closing
~/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.