3 ms·
They're not quite the same thing. Here's a post that goes over some of the differences: https://medium.com/@rakia/promise-vs-observable-vs-stream-165a310e886f#
by Eyas 8y ago
They're not quite the same thing. Here's a post that goes over some of the differences:
https://medium.com/@rakia/promise-vs-observable-vs-stream-165a310e886f#b917 https://medium.com/@rakia/promise-vs-observable-vs-stream-16...
The big difference is the pull-vs-push scheme, making Observables lazy-by-default, and just subscribed vs unsubscribed to.
Observable is a theoretical concept in reactive programming, popularized by ReactiveX author Eric Meijer.
It's gained quite a bit of popularity because ReactiveX is heavily used in Java frontends and JavaScript (Angular especially).
- mpweiher 8y agoThat article seems to take a very specific stream implementation as the basis for those purported differences. There are many others, and then the differences go away. In fact, Rx can be traced directly to the synchronous dataflow[1] of Lustre[2] and Esterel[3], which in turn goes back to Lucid[4], "The Dataflow Programming Language"[5]. It took a bit to ferret this out of the publication record, but when I asked Erik he confirmed. [1] https://ptolemy.berkeley.edu/publications/papers/87/synchdataflow/ https://ptolemy.berkeley.edu/publications/papers/87/synchdat... [2] https://en.wikipedia.org/wiki/Lustre_(programming_language) https://en.wikipedia.org/wiki/Lustre_(programming_language) [3] https://en.wikipedia.org/wiki/Esterel https://en.wikipedia.org/wiki/Esterel [4] https://en.wikipedia.org/wiki/Lucid_(programming_language) https://en.wikipedia.org/wiki/Lucid_(programming_language) [5] http://www.cse.unsw.edu.au/~plaice/archive/WWW/1985/B-AP85-LucidDataflow.pdf http://www.cse.unsw.edu.au/~plaice/archive/WWW/1985/B-AP85-L...
- Eyas 8y agoRight-- I don't disagree. But I do think 'Observable' is precise here: some streams are lazy, some streams involve pull rather than push, but if someone says "Stream" as a datatype, you don't necessarily know what they mean. But sure enough, if all we care about is a "collection of observed values, asynchronously" 'Stream' and 'Observable' fit the bill in all(most?) implementations.
- mpweiher 8y agoYeah, 'Observable' is an artefact of a specific dataflow/streaming implementation.