~/talk

Lessons learned with asyncio ("Look ma, I wrote a distributed hash table!")

Talkat EuroPython 2015 · 2015-07-20..07-26· [python]
links:none on file
slides:none on file

Asynchronous I/O using Python 3.4 asyncio actually builds a working distributed hash table: coroutines, futures and the event loop coordinate networked lookups; streams/transports/protocols handle TCP/UDP. The project, dulus, stores keys hashed with SHA-512, resolves lookups as futures and runs parallel peer queries. Implementation stays compact at 871 lines and achieves 100% unit test coverage, demonstrating a small, testable DHT that really works.

AI-written summary · about

  1. 0:00Intro
  2. 1:22WHAT DOES ASYNCIO DO..?
  3. 3:13WHAT IS A DISTRIBUTED HASH TABLE?
  4. 4:12A DISTRIBUTED HASH TABLE (DHT) IS A PEER-TO-PEER KEY / VALUE DATA STORE
  5. 5:18THE EVENT LOOP
  6. 9:12Programmers define callbacks to be run when the result of a network call is known.
  7. 9:33CONFUSED..? DON'T BE, ITS EXACTLY HOW HUMANS THINK ABOUT CONCURRENCY.
  8. 10:45asyncio avoids potentially confusing and complicated "threaded" concurrency while retaining the benefits of strictly sequential code.
  9. 11:14How do such tasks pause while waiting for non-blocking network based I/O?
  10. 11:27COROUTINES (Are FUN!)
  11. 13:34BUT WHAT ABOUT CALLBACKS? How do I handle the result of a coroutine?
  12. 16:14A DHT EXAMPLE HASHING, DISTANCE AND LOOKUPS
  13. 19:54GET() & SET() REQUIRE A LOOKUP. All interactions are asynchronous. Lookups are also parallel (concurrent).
  14. 20:39WHAT ABOUT NETWORKING?
  15. 21:55FINAL THOUGHTS... • 100% unit test coverage
~/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.