Do futures represent a pipeline? (was Re: Future cancellation)

Tab Atkins Jr. jackalmage at
Wed May 1 09:13:20 PDT 2013

On Tue, Apr 30, 2013 at 12:49 PM, Kevin Gadd <kevin.gadd at> wrote:
> Thanks, the idea that .then() returns a new Promise is very very strange to
> me. What gets stored into that promise?

Yes, promises can be through of as pipelines.  The return value of
.then() is a *new promise*, which gains its value from the .then()
callbacks - if the callbacks return a value, it accepts/resolves with
the same value; if they throw, it rejects with the error.

The reasoning behind promises/futures is explained in more detail in
my blog posts <>
<> and Domenic's

> I think I see a lot of the historical confusion here as being rooted in the
> fact that the terms 'promise' and 'future' seem poorly-suited for describing
> a pipeline oriented primitive, if that's what these futures are. Maybe all
> discussion threads on futures need a big hairy disclaimer that tells people
> to read a description of what 'future' and 'promise' actually mean in this
> context :)

I think "future" is a pretty good name, personally - it means that the
callbacks will be run in the future. ^_^  But "promise" also kinda
works, and it's more common.  But DOMFuture definitely needs more
explanatory text (which I've promised to submit a pull request to


More information about the es-discuss mailing list