MongoDB with Async Python Transcripts
Chapter: Foundations: async
Lecture: Async introduction
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
On to the next foundation. This one, Async, Async.io and Async and Await keywords in Python. At the opening of this course, I talked about Async
0:15
and how people often tell you how hard Async is and threading and concurrency and don't do it.
0:20
It's a foot gun, you'll shoot yourself on the very first day and that may be true if you're doing lots of threads,
0:28
a lot of coordinating across those threads with like events and signals and critical sections and semaphores. There are algorithms and systems
0:38
that can be extremely complex. That's not what we're talking about. What we're talking about is simple things
0:44
like I want to call, send a query to the database and I would like the system to not be blocked while I'm doing that.
0:52
So maybe you can handle a separate web request to an API or I'm talking to remote APIs or HTTP services,
1:00
and I want to be able to do more than one of those at once, but those are independent results. So in a sense, what we're doing here is async
1:09
and parallelism on easy mode, but that's kind of the point. That's mostly what you need to do, especially as a consumer of async frameworks
1:19
like Beanie and others. Okay, with that foundation set, let's dive into async.