Async Techniques and Examples in Python Transcripts
Chapter: asyncio-based web frameworks
Lecture: Python async landscape: Async web
0:00 I opened this entire course when we
0:02 started talking about async as concept of why we
0:06 really wanted it by talking about web applications.
0:09 Web applications are either calling a database
0:12 calling some microservice or external web API
0:15 or doing just a little bit of work to send
0:17 that HTML back to the browser.
0:20 But most of the time, they're waiting.
0:22 And so web APIs are really one of the key places
0:26 that asyncio just shines.
0:29 So what we're going to cover in this chapter
0:31 is we're going to talk about building websites
0:34 particular APIs with Flask
0:36 and we're going to make those async
0:39 as in async and await.
0:40 That puts is back in my favorite place
0:42 the top left, asyncio.
0:45 Like I said, I really, really like this.
0:46 Unsync sort of amplifies it across the different areas
0:49 but asyncio really, really awesome
0:50 and we're going to apply this technique
0:52 to find all the places our web app is waiting
0:55 and just set it free to go do more stuff.
0:58 Do more stuff at once and be more scalable.
1:01 This means instead of paying fifty dollars for a server
1:04 or a set of servers we're scaling up to
1:06 we might be able to spend ten and get even better
1:09 response times just because instead of having
1:11 a whole bunch of systems waiting and queuing up
1:14 threads and blocking and things like that
1:15 we'll just interweave all of this asyncio
1:18 just like we saw in the beginning.