Async in practice: how to achieve concurrency in FastAPI (and what to avoid doing!)

preview_player
Показать описание
Concurrency can be confusing. Let's dive into how to use async functions and achieve concurrency with FastAPI

00:00 Intro
1:45 Practical overview
11:49 Why things behave not like you might expect
25:08 Best practices
36:58 Quick recap

#FastAPI #asyncio #async #python #concurrency #tips
Рекомендации по теме
Комментарии
Автор

« writing async in front of every function and hoping for the best » yup that’s me 😂

hamzadlm
Автор

Лучшее видео по FastAPI что я смотрел за последнее время. Кратко и в то же время очень ёмко. Видно что автор глубоко разбирается в вопросе. Респект!

serhiiserhieiev
Автор

hi, Evgeny!
great job! crystal clear explanation!

big thanks!

dbhrxtx
Автор

You desire a million views - that is a great in-depth tutorial!

dasshrs
Автор

finally amazing explanation with good examples
I don't know how how come that you don't have a milion of views

zemalex
Автор

Excellent tutorial👌 and very accurate, precise chart. These are some much needed topics to be taken care of. My small request will be to share the code and chart in a repo, it will be much helpfull.

avitiwari
Автор

Thx for best material. It will be interesting if you do video about ASGI and WSGI web servers.

huyubosaka
Автор

Hi bro, can you make a video of using chunk method

jimmykhaidem
Автор

@evgenymaksimov 26:09 Of course, we cannot see that it has made a big difference with just a request. If you send thousands of IO-heavy requests, each request will be dedicated to a different thread, and as you said before, the application will lose performance after a while because the threads are memory hungry. If we use coroutines instead, I can say that they are lighter threads, the application will run more efficiently. Actually this may also be an answer to when to use thread and when to use async.

Автор

Did you try to use psycopg3 since it provides async?

alekseichulei
Автор

Thanks for the tutorial. I have a question, is there any way to implement server sent events in FastAPI?

akshaysarbhukan
Автор

Is it just me or our good tutor looks like Scarlett Johansson's brother 🤔. This is A really good tutorial by the way. Gives good context for how to write Async code.

payitapp
Автор

14:50 What about GIL, doesn't it forbid to create multiple threads within 1 process?

chapizishorts
Автор

can you send a book you are referring to in your video?

bdpijvz