~/talk

Common asynchronous patterns in Python

Talkat PyOhio 2016 · 2016-07-30..07-31· [python, concurrency]
links:none on file
slides:none on file

Problem: crawl a list of referrer URLs, extract links, visit each link and grab page titles. A straight synchronous loop takes about nine minutes for 60 sample sites. Thread pools don’t help because the work is IO bound; switching to event libraries—gevent, Twisted, and especially async IO with aiohttp—cuts wall time (rounded to under 3 minutes in demo). Key wins come from streaming HTML parsing and breaking work into small, testable stages wired by queues so links are queued as they’re found and consumers run concurrently.

AI-written summary · about

  1. 0:00Introduction
  2. 1:53The problem
  3. 4:48Trying threading
  4. 6:56Understanding I/O bound
  5. 9:01Using Gevent
  6. 10:33Using Twisted
  7. 14:36Using Asyncio
  8. 16:55Architecting with queues
  9. 21:06Streaming data
  10. 24:19Key takeaways
  11. 25:19Q&A
~/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.