Many of you have heard of the concept 'Promise'. Some of you may even have used
it. The 'Promise' is a useful design pattern when developing applications that
have a strong asynchronous aspect and avoids what's called 'callback hell' or
'callback christmas trees'.

The promise is a bit hard to wrap your head around though. This talk will
explain exactly how a promise works and behaves and how you should interact
with it.

Next, we'll dig into generators. Generators have been added to PHP 5.5 and
Ecmascript 6 and makes creating and consuming iterators a lot easier.

Generators have a unique language property though. They allow us to jump in
the middle of any method outside that method. In the third part of the talk
we'll show how we can use iterators to improve promise-heavy code and make
asynchronous code look and behave as normal code.


Comments are closed.

Good lecture. Very dense with a ton of good information. I think I understand better what promises and generators are, though I still don't know what kind of use-case generators are good for.

Woody Gilk at 10:49 on 18 Mar 2017

Super interesting talk. The examples were good. I'm still not entirely sure how promises are implemented with regard to generators. A little more information to link the two concepts would be helpful. Or maybe I should just go read a promise implementation.

Brian Fenton at 10:52 on 18 Mar 2017

Lots of content, moved at a good clip. Did tend to say things like "obviously" and "simple" a lot, which may be off-putting to people who hadn't run into this paradigm before.

~Echoing Woody's comment... not sure the value we add by yielding from a promise vs. calling then.~

I asked. Terseness :)

Nathan Klatt at 10:53 on 18 Mar 2017

Fascinating talk, you obviously have a deep understanding of it. Had a hard time grasping how I might apply it but probably just the nature of the subject.

Dave Buchanan at 11:32 on 18 Mar 2017

Very informative with lots of really good examples. This is something new for me...except I needed this talk 3 months ago! Would have made doing thousands of api calls much faster. And I agree with others, would have like a couple more slides on how to use promises/generators together.

David McKay at 12:40 on 18 Mar 2017

Super informative and well delivered

As Evert said, the pace of this talk was very speedy. I was OK with this during the promises overview as I use them all the time, but once the weird generator-behavior slides came in, I got pretty lost. Ultimately, the problem I wanted to solve was how to use generators to prevent long promise chains, but I am still unsure of how to do that. This might be because I got confused at the generator portion.

Korvin Szanto at 16:58 on 18 Mar 2017

Glad I made this talk! I have a lot of experience working with generators in PHP but not much working with promises so this was very helpful for me.

Anonymous at 09:25 on 20 Mar 2017

A very good talk, but got lost at the end when all the ideas were put together.

David Lim at 09:51 on 20 Mar 2017

I don't have projects that need either of these two concepts yet, but will keep them in mind so I don't get into callback hell.