Skip to main content
Rectified spelling, improved code formatting.
Source Link
Yogesh Umesh Vaity
  • 49.5k
  • 23
  • 158
  • 116

Java 8 Streams are pull based. You iterate over a javaJava 8 stream consuming each item. And it could be an endless stream.

RXJava ObservableObservable is by default push based. You subscribe to an Observable and you will get notified when the next item arrives (onNextonNext), or when the stream is completed (onCompletedonCompleted), or when an error occuredoccurred (onErroronError). Because with ObservableObservable you receive onNextonNext, onCompletedonCompleted, onErroronError events, you can do some powerfullpowerful functions like combining different ObservablesObservables to a new one (zipzip, mergemerge, concatconcat). Other stuff you could do is caching, throttling, ... And it uses more or less the same apiAPI in different languages (rxjavaRxJava, RX in C#, rxjsRxJS, ...)

By default RXJavaRxJava is single threaded. Unless you start using Schedulers, everything will happen on the same thread.

Java 8 Streams are pull based. You iterate over a java 8 stream consuming each item. And it could be an endless stream.

RXJava Observable is by default push based. You subscribe to an Observable and you will get notified when the next item arrives (onNext), or when the stream is completed (onCompleted), or when an error occured (onError). Because with Observable you receive onNext, onCompleted, onError events you can do some powerfull functions like combining different Observables to a new one (zip, merge, concat). Other stuff you could do is caching, throttling, ... And it uses more or less the same api in different languages (rxjava, RX in C#, rxjs, ...)

By default RXJava is single threaded. Unless you start using Schedulers, everything will happen on the same thread.

Java 8 Streams are pull based. You iterate over a Java 8 stream consuming each item. And it could be an endless stream.

RXJava Observable is by default push based. You subscribe to an Observable and you will get notified when the next item arrives (onNext), or when the stream is completed (onCompleted), or when an error occurred (onError). Because with Observable you receive onNext, onCompleted, onError events, you can do some powerful functions like combining different Observables to a new one (zip, merge, concat). Other stuff you could do is caching, throttling, ... And it uses more or less the same API in different languages (RxJava, RX in C#, RxJS, ...)

By default RxJava is single threaded. Unless you start using Schedulers, everything will happen on the same thread.

Source Link

Java 8 Streams are pull based. You iterate over a java 8 stream consuming each item. And it could be an endless stream.

RXJava Observable is by default push based. You subscribe to an Observable and you will get notified when the next item arrives (onNext), or when the stream is completed (onCompleted), or when an error occured (onError). Because with Observable you receive onNext, onCompleted, onError events you can do some powerfull functions like combining different Observables to a new one (zip, merge, concat). Other stuff you could do is caching, throttling, ... And it uses more or less the same api in different languages (rxjava, RX in C#, rxjs, ...)

By default RXJava is single threaded. Unless you start using Schedulers, everything will happen on the same thread.