You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observable.range(0, Integer.MAX_VALUE).map(i -> "lineOfData-" + i) // simulate the file with many lines
.buffer(100) // buffer up chunks of work before processing them
.flatMap(chunk -> {
returnObservable.just(chunk).subscribeOn(Schedulers.io()) // put each group on a new thread (io scheduler for blocking IO)
.doOnNext(t -> {
// do work heretry {
Thread.sleep(1000);
} catch (Exceptione) {
}
// write out on blocking IO as a side-effectSystem.out.println("Emitting to IO: " + t);
});
}, maxConcurrentValueHere).toBlocking().forEach(System.out::println);
To allow use of
merge(Observables..., maxConcurrent)
via flatMap we should consider adding aflatMap(Func, int maxConcurrent)
overload.The text was updated successfully, but these errors were encountered: