W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

Re: Cancelable promises

From: Samuel Giles <sam.e.giles@gmail.com>
Date: Fri, 27 Feb 2015 23:12:35 +0000
Message-ID: <CAPXHV4peOAsXPtK4Xeu4vTk8ws0q9VqRy4rk3+FgMvOMF570_w@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>, Andrea Giammarchi <andrea.giammarchi@gmail.com>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>, es-discuss <es-discuss@mozilla.org>
Re fetch: https://github.com/whatwg/fetch/issues/20

On Fri, 27 Feb 2015 23:08 Jonas Sicking <jonas@sicking.cc> wrote:

> On Thu, Feb 26, 2015 at 11:43 PM, Andrea Giammarchi
> <andrea.giammarchi@gmail.com> wrote:
> > AFAIK bluebird did:
> > https://github.com/petkaantonov/bluebird/blob/master/API.md#cancelerror-
> reason---promise
> >
> > But I agree once you've made Promises more complex than events ( xhr in
> this
> > case ) nobody wins :-/
> >
> > Although, specially for fetch or anything network related, there
> **must** be
> > a way to bloody cancel that!
> >
> > ....right?
>
> Yeah. Most IO operations do need a way to cancel. And hopefully all of
> them will be returning Promises.
>
> I definitely agree that providing cancelability on Promise will add
> complexity. That said, the pattern of making heavy long-running APIs
> return a Promise, and wanting to enable cancelling them, is likely
> going to be common.
>
> So finding a good solution to that pattern seems worthwhile.
>
> / Jonas
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
Received on Saturday, 28 February 2015 21:15:56 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 28 February 2015 21:16:05 UTC