2.1.2 Completable with andThen never completes
See original GitHub issueThis test fails:
Completable.complete()
.andThen{ Completable.complete() }
.test()
.assertComplete()
However this one succeeds:
Completable.complete()
.test()
.assertComplete()
This one also succeeds:
Flowable.just("")
.flatMap { Flowable.just("") }
.test()
.assertComplete()
My understanding is that concating (which is what andThen does?) two completables which complete immediately should complete. I tried:
- using
awaitForTerminalEvent
but it just runs forever in the first case. .andThen{}
instead of.andThen{ Completable.complete() }
Completable.fromCallable
instead ofCompletable.complete()
or switching from aFlowable
toCompletable
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:15 (5 by maintainers)
Top Results From Across the Web
CompletableSubject (RxJava Javadoc 2.1.2)
public final class CompletableSubject extends Completable implements CompletableObserver ... Returns true if this CompletableSubject has been completed.
Read more >RxJava `Completable.andThen` is not executing serially?
The issue is not with andThen but with the statement Observable.just(mUser.name) inside andThen . The just operator will try to create the ...
Read more >RxJava Completable.andThen never triggers the second ...
Try: andThen(userService.updateMessagingUserLanguages(user.id, languageRequest)). IOW, replace the lambda expression as a parameter with the ...
Read more >Completable (RxJava Javadoc 2.2.21) - ReactiveX
Returns a Flowable which will subscribe to this Completable and once that is completed then will subscribe to the next Flowable. <T> Single<T>,...
Read more >Completable (RxJava Javadoc 3.1.5) - ReactiveX
Disposable d = Completable.complete() .delay(10, TimeUnit. ... Returns a Completable that first runs this Completable and then the other CompletableSource .
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You want andThen(Completable.complete()). Note the use of parenthesis and not curly braces. The latter creates a lambda that doesn’t call its emitter.
On Sat, Aug 12, 2017, 11:30 AM Michał Klimczak notifications@github.com wrote:
Please be patient on StackOverflow (deleted) next time!