We have pretty sound cancellation semantics in bluebird 3. http://bluebirdjs.com/docs/api/cancellation.html
Handles multiple subscribers soundly. Solves the common use cases pretty well - has absolutely zero magic and pretty simple semantics. They work with .all and .race too. We have had a lot of positive feedback regarding the change and it works well (at least in my code) with async/await and other newer proposals. Biggest downside is that it hasn't been used for very long yet in production (<year) - it often takes longer to discover problems. It would be great if the TC and the list took a look at the bluebird cancellation semantics - they took years to nail. So here I am bringing them to your attention. I'll probably stay out of arguments but feel free to ask any questions if you'd like. > On 4 Jan 2016, at 19:55, Tab Atkins Jr. <jackalm...@gmail.com> wrote: > >> On Mon, Jan 4, 2016 at 9:01 AM, Domenic Denicola <d...@domenic.me> wrote: >> From: Kevin Smith [mailto:zenpars...@gmail.com] >> >>> And what's the deal, is it canceled or cancelled? : ) >> >> This is kind of the worst. Previous discussion at >> https://github.com/promises-aplus/cancellation-spec/issues/4. >> >> Data seems to favor cancelled: >> >> - >> https://books.google.com/ngrams/graph?content=canceled%2Ccancelled&year_start=1800&year_end=2020&corpus=15&smoothing=3&share=&direct_url=t1%3B%2Ccanceled%3B%2Cc0%3B.t1%3B%2Ccancelled%3B%2Cc0 >> - http://www.google.com/trends/explore#q=cancelled%2C%20canceled&cmpt=q >> - http://www.googlefight.com/canceled-vs-cancelled.php > > The best approach in cases like this is to avoid the word altogether. > The fact that there's confusion at all means people will mess it up > and get annoyed, even if there's a "winner" in overall usage. > > On Mon, Jan 4, 2016 at 9:36 AM, Kevin Smith <zenpars...@gmail.com> wrote: >>> I am also unsure when .whenCanceled is necessary >> >> Maybe in the case where you have a promise-returning function and you want >> to reject the returned promise upon cancellation. >> >> function delayWithCancel(ms, cancelToken) { >> return new Promise((resolve, reject) => { >> setTimeout(resolve, ms); >> cancelToken.whenCancelled(reject); >> }); >> } > > Yes, forcing people to poll an attribute of a Promise-like thing is > kinda ridic. ^_^ > > ~TJ >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss