Is there a difference between Netflix's RxJava Observables and Guava's ListenableFutures?

StackOverflow https://stackoverflow.com/questions/21458271

  •  05-10-2022
  •  | 
  •  

Question

I'm using plain old Java 1.6, and am interested in both these libraries.

Having read the documentation, I'm not sure of the differences, if any. Can anyone explain it, or point me at some relevant info? Thanks in advance!

Was it helpful?

Solution

RxJava does a lot more than the ListenableFutures. I'm not familiar with ListenableFutures, but from the docs it seems that it is simply Futures with callbacks and a few simple methods to compose them. On the other hand, RxJava (or the original Reactive Extensions for .NET, which are a huge inspiration to RxJava) models also sequences of values over time - data in motion, basically anything from a stream of mouse moves to a stream of network packets or database results. It also provides various scheduling strategies and many combinators to compose the streams. A good introduction to RxJava and even comparison to the futures is at the wiki page of the project. You can also have a look at Intro to Rx for an introduction to the general concept.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top