Questions tagged [rx-java3]
149 questions
0
votes
0 answers
How to run Firebase auth function in Android in Background using RX?
I want to run my check user function in background, and rx do it. but a result of callback works only in main thread. the picture down shows it
Can i do all of the code with signInWith() and addOnCompleteListener() in background thread, created by…

maks099
- 23
- 3
0
votes
0 answers
rxjava: thenReturn Single.error vs thenThrow Exception
I am writing an unit test for methodOne and am trying to simulate an exception scenario.
Single methodOne() {
methodTwo();
return Single.just("Hello");
}
Single methodTwo() {
//some network calls
return…

rangarok
- 1
0
votes
0 answers
how to get main thread variables in RxJava3
Say I have some variables stored in ThreadLocal and how can I fetch them in below 'mapper' method?
ThreadLocal data = new ThreadLocal<>();
data.set("some data");
Flowable.fromIterable(xxx)
.parallel(4)
…

rellocs wood
- 1,381
- 4
- 21
- 36
0
votes
0 answers
RxJava compatibility with Rsocket
Im going through RSocket implementation for Java using this https://github.com/rsocket/rsocket-java, but could only find Reactor support(Flux,Mono)
I cannot see any RxJava(Observables) support with RSocket.
Is this understanding correct ?
I tried to…

akshay jangid
- 1
- 4
0
votes
1 answer
For RXJava Observable doFinally is not called even after onComplete. Is there a way to explicitly called doFinally?
I have the following code which creates a simple Observable, emits an Integer and calls onComplete. According to https://medium.com/@ValCanBuild/making-rxjava-code-tidier-with-doonsubscribe-and-dofinally-3748f223d32d doFinally — Calls the specified…

Jay Dharmendra Solanki
- 659
- 8
- 17
0
votes
0 answers
how to use Rxjava with room and use mvvm with LiveData //How do I switch usage from executorService to rxjava?
enter image description here
What is the best approach to replace the use of executorService with RxJava in a repository class that is used with ViewModel and LiveData in an Android app?

kareem mohamed
- 1
- 2
0
votes
0 answers
I want to show data from room database in recycler view using pager
Room Dao:
@Query("SELECT * FROM any_table")
List getAllAny();
I want to use Pager3 with Rx Java to show the data in recyclerview because loading all data at once lags UI.
If possible change the return type of query to flowable or something…
0
votes
0 answers
How to run a set of callables in parallel by using Flowable and Single
I have 4 blocking operations and would like to run them in parallel by using RxJava Single/Flowable.
The test code that I wrote to check parallelism is:
final Single f1 = Single.fromCallable(() -> {
TimeUnit.SECONDS.sleep(2);
…

Enrique Molina
- 85
- 8
0
votes
1 answer
using Rxjava with flatmap not change the downstream data
RxJava3
Kotlin
I have the following method and I am trying to control the downstream to return the Pair after the map operator
However, after the first flatMap the data is changes to customer. Basically, I want to return the…

ant2009
- 27,094
- 154
- 411
- 609
0
votes
0 answers
RxJava - how to make dynamic api calls & add responses to list
I'm new to RxJava, using RxJava 3 to return a response that contains a dynamic number of urls that I then need to make GET requests to and then add those responses to a list that is to be observed by the ui. Since the number of urls returned is…

Iam Me
- 33
- 8
0
votes
0 answers
How to block UI until Observable gets a response or timeout?
In my Android project I have a simple switch with a boolean interface to be imlemented later:
Switch (
text: String,
val isSwitchChecked: (Boolean) -> Unit
)
which I use like:
Switch("Measure Temperature"){ it: Boolean ->
Observable
…

Ralf Wickum
- 2,850
- 9
- 55
- 103
0
votes
1 answer
Room - Embedded object and the where clause with LiveData
This is sort of a continuation from my previous one, but I finally figured that one out (got rid of the duplication issue).
Android Room Relationship duplicating information
Customer table
@Entity(tableName = "customer_table")
public class…

Raymond Herring
- 347
- 1
- 3
- 10
0
votes
1 answer
Multiple chained API calls to fetch data, but doOnNext of PublishSubject is never reached
I have a problem to understand a chained "RXJava-Retrofit" API call. I got inspired by this and implement this class named ObservationLoader to load the data from the API bucket per bucket. When the end of data is reached the API sends a…

Felix
- 556
- 1
- 5
- 12
0
votes
0 answers
Rxjava3 onNext method is executed after a long delay
I use the following code to realize the countdown display at the millisecond level. After onSubscribe is executed, the onNext method is executed nearly one minute later.
This problem occurs occasionally. This problem also exists when creating…

Jin
- 31
- 2
0
votes
0 answers
Why Rxjava3 Observable on main thread miss sometimes while in doze mode?
I am using rxjava3 observable in foreground service to sync data after every 3 minutes but this observer miss sometime when phone in doze mode
disposable = Observable.interval(1, 3 * 60 * 1000, TimeUnit.MILLISECONDS)
…

Ahmad Ali
- 23
- 6