Skip to content
Advertisement

Tag: rx-java

Can I delay the onSuccess method in RxJava?

I have SplashScreenFragment and inside this fragment, I’ll load the data from the server using Retrofit with RxJava, Getting data from the server will take between 1 second to 25 seconds. The SplashScreenFragment must show to the user for at least 8 seconds. When I get the data from the server, The onSuccess method will be called and inside this

RxJava3. Why FlowableSubscriber onNext has not been called?

I need to get a Subscription object to have an opportunity of unsubscribing listeners. For this I want to give a FlowableSubscriber to function. Code: Logs are: If I use lambdas it works, but there is not onSubscribe callback. How can I get a subscription and why these mathods haven’t been called? Answer Since Flowable supports backpressure you have to

Why is doOnDispose not called?

When creating an Observable like this: doOnSubcribe is called, doOnDispose is not called. Why is that? Answer You need to use the doFinally() operator. doOnDispose() has a very narrow use case, where the observable is explicitly disposed. In your example, the observable terminates “naturally” by onComplete(). By the time that you call dispose(), the observable is done, and nothing will

What is the difference between concatMap and flatMap in RxJava

It seems that these 2 functions are pretty similar. They have same signature (accepting rx.functions.Func1<? super T, ? extends Observable<? extends R>> func), and their marble diagrams look exactly same. Can’t paste the pics here, but here’s one for concatMap, and here’s one for flatMap. There seems to be some subtle difference in the description of resulting Observable, where one

Advertisement