-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
io.reactivex.rxjava2:rxjava:2.2.3
public class DemoApplication {
public static void main(String[] args) {
List<Map.Entry<Integer, String>> entries = Arrays.asList(
new AbstractMap.SimpleImmutableEntry<>(3, "hello"),
new AbstractMap.SimpleImmutableEntry<>(3, "world")
);
Flowable.fromIterable(entries)
.flatMap(entry -> Flowable.range(1, entry.getKey())
.parallel()
.runOn(Schedulers.io())
.flatMap(i -> logIt(entry.getValue()).toFlowable())
.sequential()
)
.all(success -> success)
.doOnSuccess(success -> System.out.println("good"))
.doOnError(Throwable::printStackTrace)
.blockingGet();
}
private static Single<Boolean> logIt(String s) {
System.out.println(s);
return Single.just(true);
}
}
This code works as expected. However, replacing Schedulers.io()
with TestScheduler
blocks forever. Gradle project attached.