Next-Level Concurrent Programming In Python With Asyncio

preview_player
Показать описание
If your software interacts with external APIs, you need to know concurrent programming. I show you how it works in Python and then take it to the next level by showing advanced concurrent features such as using async with generators and comprehensions, show a simple way to turn blocking code into concurrent code, and then I cover how concurrency affects software design and architecture.

🎓 Courses:

👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!

👀 Code reviewers:
- Yoriz
- Ryan Laursen
- James Dooley
- Dale Hagglund

🔖 Chapters:
0:00 Intro
1:10 Concurrency vs parallelism
2:33 The Global Interpreter Lock
3:06 The benefits of concurrency
4:36 Recap of asyncio in Python
7:13 Using gather to send out multiple requests
9:44 How async and await are integrated into Python's syntax
11:54 Turn blocking code into concurrent code
16:04 Async http requests
16:53 Aiohttp
17:50 Concurrency, design patterns, and architecture

#arjancodes #softwaredesign #python

DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
Рекомендации по теме
Комментарии
Автор

Let's go deeper in async. Exceptions handling, pubsub pattern and how to manage back pressure.

MrTrebor
Автор

I'd be great to see a series of concurrency/parallelization in python.

BladeAndrade
Автор

Regarding your criticism about nested contextmanagers (at 17:35)...

Since Python3.10 you are able to write something like this:

async with (
aiohttp.ClientSession() as session,
session.get(url) as response,
):
return await response.json()


This is super usefull :)

arthurguz
Автор

Love, love, love your presentation style; so systematic, well thought out, and articulate.

cetilly
Автор

Very helpful video, Arjan! Exactly what I was looking for! I will be looking forward to even more asyncio videos from you! Thank you!

sval
Автор

15:13 You could leave out both the “await” and the “async”. So “send‗async‗request” becomes a regular function which returns an awaitable.

lawrencedoliveiro
Автор

Hey Arjan! Thank you for such amazing contents I have learned a lot from your videos. It will be great to see videos about Threading and Multiprocessing.
Thank you again.

sudadal-ajili
Автор

Thanks so much - Learning a lot from here . A friend of mine recommended your channel, now I am passing it on to others . Good Luck

MrJjthecronfan
Автор

Hi Arjan, your videos have been of really great help to me. If possible, a video about using the Aiohttp module with asyncio would be really nice. Fingers crossed. Thank you for all you do!

tobilobaogunware
Автор

Best video on async, finally someone who shows why, when and how to use async. Cleared all my doubts, Thank you

varswe
Автор

I can't count the amount of times I've tried to find the best method for asnyc requests. I've used aiohttp just like you but it never felt right, but I never understood asyncio enough so this was always something I was scared of more than I should have. I am so happy that you have actually shown the best way to do it, it will help a lot in my everyday work!

CaptainCsaba
Автор

I really like the practical approach of exploring the topic, it's my favorite way of learning things. Keep going!

just subscribed and signed up for the diagnosis course, eager to start and jump to the next ones. Thanks for sharing <3

seeds_of_growth-yigx
Автор

That is very useful and interesting video discussing asyncio library. I was about to read the docs, but now I think I don't have to, thanks to your video! Great content! Thanks for that!

michtesar
Автор

Great video. We are doing a bunch of data ingestion from a rest api right now so this is very top of the mind.

getpoked
Автор

Thanks so much! Love to see your videos. Thanks so much for making and sharing them! ^_^

Whatthetrash
Автор

Loving it! Thanks Arjan.. this video was very informative, would like to see more videos on async python 🙏

aashayamballi
Автор

you didn't mention the difference between using `requests` + `to_thread`, and `aiohttp`. Although `aiohttp` is more verbose, it is faster since it involves no threads. You can also reduce indentation by creating the session beforehand and reusing it.

leoff
Автор

Thanks for improving the way the video looks

walis
Автор

Arjan, I really like your videos. Could you please make more content on async Python? This content (unlike many other topics) is barely covered on YouTube, so you'll be guaranteed to have lots of views and we'll be guaranteed to have a more deep understanding of that complex topic.
Multiprocessing and multithreading topics are also highly anticipated.

arturkabitcher
Автор

This video helped me a lot! thank you so much!💌

tharo