Nathaniel J. Smith - Trio: Async concurrency for mere mortals - PyCon 2018

  Рет қаралды 28,460

PyCon 2018

PyCon 2018

Күн бұрын

Пікірлер: 19
@KevinZJR
@KevinZJR 5 жыл бұрын
Trio is a big step forward in asynchronous programming IMHO. It's hard to capture its many concepts in such a short talk. If anyone wants to know more, Mr Smith's great blog posts on structured concurrency and cancel scope the place to start.
@aweffrle7264
@aweffrle7264 6 жыл бұрын
Very very helpful talk, thank you. Now I get the feeling that I can implement "Happy Eye Balls" and some other things I did in Rxjs. I'm going to try Trio right now.
@armynyus9123
@armynyus9123 2 жыл бұрын
Just stumbling over trio - question to you: did you try trio? I still like the declarative approach of Rx and was thinking of using Rx in Python as well. Would you say trio is "better", for many use cases?
@rujingwang1476
@rujingwang1476 2 жыл бұрын
Are there more lectures by Nathaniel J. Smith ? Best presenter ever
@michaelnajera7958
@michaelnajera7958 4 жыл бұрын
coming from kotlin, I'm glad that structured concurrency is available in Python, also. Great intro
@fredeisele1895
@fredeisele1895 6 жыл бұрын
Consider the case where an exception is stating that the process has an unbound resource. One of its ancestors should have the opportunity to bind something to that resource so the descendant has a chance to finish its work before it is killed. That is the closing of the child processes is contingent upon the exception being unresolved.
@AbeDillon
@AbeDillon 6 жыл бұрын
I wish Mr. Smith had spent more time explaining what's going on in the diagram at 19:28 He then jumps to some code where nothing is labeled "nursery" at 19:32 I know he was given a very short window to speak, but the idea of a nursery seems pretty important and I still don't quite get it.
@nathanielsmith2547
@nathanielsmith2547 6 жыл бұрын
Ah yeah, that bit at 19:32 is kinda unclear, isn't it? It was pretty tough describing the whole "theory of nurseries" in 5 minutes :-). If you want a more leisurely version, I'd recommend this blog post: vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ But about the slide at 19:32 in particular: The point I was trying to make is that in a lot of systems (e.g., twisted, asyncio), a function like proxy_two_way() might just start the proxying happening in the background, so when the function returns, you don't really know whether it's still running. So, just looking at the code on that slide, we can't tell whether it's safe to close the stream handles we passed in -- it might still be using them! But in Trio, we know it's safe to close the handles, *even if we have no idea what proxy_two_way actually does.* It might open a nursery internally, but then it has to close that nursery again before it returns, which means that any tasks it spawns have to be finished before it returns. (And in fact if you look at the complete code, at 9:05, then you'll see that it does open a nursery internally!) Because Trio mandates the use of nurseries, the only way proxy_two_way could leave things running after it returns is if we *pass in* a nursery object, and just from the code on the slide at 19:32 we can see that we're not. Hope that helps! (And sorry for the slow response, I don't get any notification of comments here. If you have more questions, then gitter.im/python-trio/general is a better place to reach me and the other Trio devs :-).)
@AbeDillon
@AbeDillon 6 жыл бұрын
*Hope that helps! (And sorry for the slow response* LOL! You better be sorry for writing such a helpful, informative response! Now get back to making more open source software that I'll probably use to make my life easier! Man... complaining about stuff on the internet is such a thankless job ;) Honestly, though. This is a fantastic response and I look forward to seeing how Trio develops! I might even pitch in!
@nathanielsmith2547
@nathanielsmith2547 6 жыл бұрын
:-) > I might even pitch in! That would be awesome. It turns out reinventing I/O and concurrency is kind of a big job, so there's no shortage of places to help :-). If you're interested, we have a handy contributing guide: trio.readthedocs.io/en/latest/contributing.html
@simonmasters3295
@simonmasters3295 6 жыл бұрын
coding for concurrency is my challenge-problem too, @@nathanielsmith2547 because I have an interest in maker projects (e.g. Arduino-Pi) that require its control at the sub-second (mHz, GHz) level of frequencies Makes me think what do KZbin use, and shouldn't KZbin be sponsoring the work of your community?
@donha475
@donha475 5 жыл бұрын
Very good talk
@nikjs
@nikjs 5 жыл бұрын
so civilized.
@killerthoughts6150
@killerthoughts6150 Жыл бұрын
A m a z i n g
@RoamingAdhocrat
@RoamingAdhocrat 3 жыл бұрын
16:55 nice
@gaatutube
@gaatutube 5 жыл бұрын
Somehow the syntax just seems unnatural to me when you say sink.send_eof( ) or sink.send_all(data). Makes it sound like as if sink is the one doing some work, when in fact we want to say "send all data TO sink" or "send an eof to sink". Perhaps a syntax like *trio.send_eof(sink)* or *trio.send_all(data, sink)* would be more intuitive.
@kriss1_
@kriss1_ 5 жыл бұрын
I think the usage of the word 'sink' as the object name here is very deliberate, to make it implicitly tell you that it isn't actually doing anything itself - just passing through something - like a real sink just passing water through to whatever is at the end of the piping on the other side. Thinking like this makes the usage pretty clear for me.
@ggsap
@ggsap 2 жыл бұрын
Wow! This is worthless
@nocturn9x
@nocturn9x 9 ай бұрын
lol says who
Kyle Knapp - Automating Code Quality - PyCon 2018
29:45
PyCon 2018
Рет қаралды 10 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Project Loom - Structured Concurrency
36:24
Java
Рет қаралды 17 М.
Nathaniel J Smith - Python Concurrency for Mere Mortals - Pyninsula #10
47:45
David Beazley - Reinventing the Parser Generator  - PyCon 2018
45:01
Carl Meyer - Type-checked Python in the real world - PyCon 2018
32:10
#167: Simplifying Python's Async with Trio
55:42
Talk Python
Рет қаралды 876
Raymond Hettinger, Keynote on Concurrency, PyBay 2017
1:13:53
SF Python
Рет қаралды 153 М.