Promises vs Streams

Axel Rauschmayer axel at rauschma.de
Sat Mar 28 16:11:17 UTC 2015


Synchronously, we have both normal (synchronous) function calls and iteration over a sequence of values (via `for-of` and iterators). It makes sense that we also should have two abstractions for asynchronous interaction.

> On 28 Mar 2015, at 13:14, Boopathi Rajaa <legend.raju at gmail.com> wrote:
> 
> I feel this must have already been discussed but couldn't find any discussion threads, just trying to understand them better.
> 
> The basic doubt is that I feel promises are more like streams, and that streams are much more powerful than promises. With a promise you have a value or an exception, and with a stream, you have a list of values or an exception. 
> 
> Why do we have both ? or more specifically, since we have both, when to use Promises and when to use Streams ? Whatever I imagine to be a Promise can be thought out to be solved by Streams, and sometimes whenever I use streams, it feels like I'm using similar API as Promises.
> 
> - Boopathi
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150328/58b4f46a/attachment.html>


More information about the es-discuss mailing list