Questions tagged [rx-java]

RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

RxJava is a Java implementation of Reactive Extensions. Android-specific support for RxJava is provided by .

The main goals of RxJava

  • Stay true to the principles and concepts behind the original implementation while adjusting to the naming conventions and idioms of Java
  • All contracts of Rx should be the same target - the JVM
  • JVM-based languages supported (beyond Java itself) include , , , and
  • Support Java 6+

The library is open sourced under Apache 2.0 license.

References

6958 questions
3
votes
1 answer

Using RxJava to join local data with remote ( or cached ) data

This is working code but I have a few questions as well as a request for advice on improving it. I am new to RxJava and I have not fully wrapped my head around how to chain these type of observables together. I have two model objects, ListItem and…
Matthew Smith
  • 4,387
  • 3
  • 15
  • 14
3
votes
2 answers

How to throttle/debounce seekbar seek events in MediaPlayer app

I'm writing a MediaPlayer Android application and wanted to throttle/debounce Seekbar events. Couldn't find a good solution to minimize the number of seek operations that is generated when a user moves his finger on the seekbar. What is the…
3
votes
1 answer

reactivex and REST Web services

I have a situation where an application has a list of values, for example, a list of books, that changes from time to time. It also has a REST endpoint where this information is published. There are several other applications that consume this…
Kelly Goedert
  • 1,027
  • 2
  • 11
  • 37
3
votes
3 answers

Why does it need onBackpressure() here for click events?

I'm trying to make error handling for some action bound for button clicks. For binding I use RxAndroid+RxAndroid. Seems like it must work with code below, but it doesn't with commented line with onBackpressure(): CurrentUser signIn() { throw…
Nexen
  • 1,663
  • 4
  • 16
  • 44
3
votes
1 answer

RxJava flatMap and backpressure strange behavior

While writing a data synchronization job with RxJava I discovered a strange behavior that I cannot explain. I'm quite novice with RxJava and would appreciate help. Briefely my job is quite simple I have a list of element IDs, I call a webservice to…
benjamin.donze
  • 446
  • 3
  • 19
3
votes
3 answers

RxJava: How to Subscribe only if the Observable is Cold?

TL;DR: How do you create an Observable that only creates a Subscription if it is cold and queues any other subscribe calls when it is hot? I would like to create an Observable which can only execute a single Subscription at a time. If any other…
bkach
  • 1,431
  • 1
  • 15
  • 24
3
votes
1 answer

Rxjava takeWhen operator

I was looking an rxjava operator which waits another observable emits an item to observe an item. I can do it with flatMap and map operators but I just wonder if there is an operator which does this job. I am looking for opposite of takeUntil…
ferpar1988
  • 596
  • 2
  • 5
  • 17
3
votes
1 answer

When using Schedulers, System.out.println prints nothing in RxJava

I'm fiddling around with RxJava and Schedulers. I implemented a very simple stream with a scheduler: Observable.just(1, 2, 3) .doOnNext(v -> Thread.currentThread().getName()) .subscribeOn(Schedulers.newThread()) .subscribe(v ->…
tomdavies
  • 1,896
  • 5
  • 22
  • 32
3
votes
2 answers

RxJava/Android monitor progress of multiple subscribers fired at different times

I am looking for a way, hopefully using RxJava for consistency, to monitor the progress of multiple subscribers that may be fired at different times. I am aware of how to merge or flatMap subscribers together when they are all fired from one method…
Ben Trengrove
  • 8,191
  • 3
  • 40
  • 58
3
votes
1 answer

Rxjava cache operator

I want to cache observable items for subsequent subscriptions but I don't want to cache errors. It seems cache operator also caches throwables. How can I achive that?
ferpar1988
  • 596
  • 2
  • 5
  • 17
3
votes
1 answer

rxJava and retrofit instead of IntentService + CursorLoader?

In my app I use IntentServices every time I do a network call. I use Volley for handling the HTTP communication and the results are stored in a database (using ContentProvider). In my Activities/Fragments I use CursorLoaders to update my UI…
3
votes
1 answer

Obtaining reference to original Scheduler

I have the following RxJava Observable: final class MapBitmapObservable { static Observable create(@NonNull final MapView mapView) { return Observable.create(new Observable.OnSubscribe() { @Override …
stkent
  • 19,772
  • 14
  • 85
  • 111
3
votes
1 answer

Is it possible to run a Retrofit observable synchronously?

I'm trying to migrate my app to work with RxJava. I already use Retrofit and therefore I'm trying to use a Retrofit interface which methods return Observables. However I'm now having issues with coding tests against it, as I can't get the Observable…
nyarlathotep77
  • 181
  • 1
  • 9
3
votes
1 answer

Using RX to communicate between two components through a mediator

C1 and C2 are components that don't know about each other. C1 does things that C2 cares about. I use a "Manager/Mediator" to allow communication between them. Both C1 and C2 reference this mediator. C1 calls method mMediator.notifyItemProduced()…
siger
  • 3,112
  • 1
  • 27
  • 42
3
votes
1 answer

How to create custom Subscriber?

I want to display progressDialog while observable is downloading file , and when it's done want to send file to subscriber. I tried to make my custom subscriber by extends from Subscriber for example: public abstract class MySubscriber extends…
NickUnuchek
  • 11,794
  • 12
  • 98
  • 138