Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Lessons Learned with Asyncio - Look Ma, I Wrote a Distributed Hash Table

EuroPython Conference via YouTube

Overview

Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the fundamentals of asyncio in Python through a practical application of building a distributed hash table in this EuroPython 2015 conference talk. Dive into the event loop, coroutines, futures, and networking concepts with real-world code examples. Gain a solid understanding of asyncio's core components, including its ability to handle non-blocking network-based I/O and maintain sequential code benefits without the complexities of threaded concurrency. Learn how to implement key DHT operations like GET() and SET() using asynchronous and parallel lookups. Discover the intricacies of streams, transports, and protocols in asyncio-based networking. By the end of this introductory session, acquire enough knowledge to confidently explore asyncio further and potentially incorporate it into your own projects.

Syllabus

Intro
WHAT DOES ASYNCIO DO..?
WHAT IS A DISTRIBUTED HASH TABLE?
A DISTRIBUTED HASH TABLE (DHT) IS A PEER-TO-PEER KEY / VALUE DATA STORE
THE EVENT LOOP
Programmers define callbacks to be run when the result of a network call is known.
CONFUSED..? DON'T BE, ITS EXACTLY HOW HUMANS THINK ABOUT CONCURRENCY.
asyncio avoids potentially confusing and complicated "threaded" concurrency while retaining the benefits of strictly sequential code.
How do such tasks pause while waiting for non-blocking network based I/O?
COROUTINES (Are FUN!)
BUT WHAT ABOUT CALLBACKS? How do I handle the result of a coroutine?
4 FUTURES AND TASKS (Are also FUN!)
A DHT EXAMPLE HASHING, DISTANCE AND LOOKUPS
GET() & SET() REQUIRE A LOOKUP. All interactions are asynchronous. Lookups are also parallel (concurrent).
WHAT ABOUT NETWORKING?
6 & #7 STREAMS, TRANSPORTS AND PROTOCOLS (Are also a lot of FUNI)
FINAL THOUGHTS... • 100% unit test coverage

Taught by

EuroPython Conference

Reviews

Start your review of Lessons Learned with Asyncio - Look Ma, I Wrote a Distributed Hash Table

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.