'How Do Python Coroutines Work?'

preview_player
Показать описание
At Open Source Bridge and PyGotham in 2015, I demonstrated that you can code a Python 3 async framework in about a half hour. I start the demo by writing a callback-based async framework, built on non-blocking sockets and a simple event loop. Then I adapt the framework to use generator-based coroutines, which are cleaner than callbacks but still more efficient than threads for async I/O.

For more information on this topic I've made you a page of links:

Рекомендации по теме
Комментарии
Автор

It's very hard to find even slightly esoteric Python tutorials, let alone someone with a great understanding and who is very well-spoken. Thank you for this! I've been using Select() for the past few years, but I'm moving to Python3 and I'm trying to find videos that aren't 'beginner-level' to put it lightly. This is fantastic!

SecularSerenity
Автор

I followed and worked it all out. Thanks for lesson although a while ago...motivating. Coding at 64 years of age and still ticking strong!

Broswhoknowstuff
Автор

Some of the tutorials are classic. For me this is one of them.

kumarrohit
Автор

A very clear explanation of async programming fundamentals in Python. Superb!

JumpingCow
Автор

Jesse, please do more tutorials. This is a great especially for such a complex concept. I've watched videos from Beazley and Hettinger on this topic, which were great in their own respect; but yours actually finally hit it home for me. Thanks!

bchoor
Автор

Loved the video, thanks for this! One of the best Python tutorial presenters I've seen!

combatLaCarie
Автор

I have absolutely no idea whats going on but i genuinely enjoyed watching it !

kevinfairweather
Автор

This tutorial is very useful to me, and it helps me better understand the concept of coroutines by writing code. thank you jesse

leealvin
Автор

That moment when you've just learned something new and interesting then it turns out to be the intro.

pward
Автор

Cool! I did apply at MongoDB. I'm a recent graduate of 2 year CIS - Software Application Dev AAS degree, though I've been technically programming since I was 9 using basic on a commodore 64. lol. Anyways, thank you for the video! I'll be looking for more. I've subscribed. Looking for any good, informational video with Python and anything (database, networking, anything I don't know yet (which is plenty!!) etc) Thank you again. :)

StevenSmith-qzzg
Автор

My brain just melted while waiting for next() to be called

kellypainter
Автор

Geez...I thought I was ready for advanced but um I think I am going to go back to the basics, xd.

zzzzzz...
Автор

that was really informative ! Thank you, Sir for posting a great video.

sdalmudhafer
Автор

Thanks man, this was explained very well and makes a lot of sense.

IcarianVX
Автор

wow, 45 minutes went by so fast... great tutorial, thanks a lot!

igormiholic
Автор

But when you make the first get, can you try to set keepalive, like for the second request, you don't need to open socket again

LaVidaEnUnaGota
Автор

It's very good to learn A.Jesse. Thanks a lot for the video demonstration...

EazyTutor
Автор

Amazing insight into coroutines, thank you for the tutorial.
However, is it a good idea to use coroutines for CPU intensive work? I did read somewhere, with asyncio, one can create coroutines with ProcessPoolExecuters. It would be great to have an insight into how that works.
Thank you.

alaypatel
Автор

Great tutorial, and there is a nice select()/selectors tutorial hiding in there.

ArturdeSousaRocha
Автор

Instead of using a selector wouldn't be easier to just put "s.send(request.encode())" and the receiving loop into the try exception after s.connect('localhost', 5000') ?
Edit:
I got it. This way we do not bother the OS with failing read-write attempts.

attilamolnar
join shbcf.ru