Slide 117
Slide 117 text
The Battle
Solution :
Observable.interval(1, 1, TimeUnit.MICROSECONDS)
.take(129)
.buffer(10)
.flatMap(new Function, ObservableSource>() {
@Override
public ObservableSource apply(List longs) throws Exception {
return Observable.fromIterable(longs)
.reduce("", new BiFunction() {
@Override
public String apply(String oldString, Long aLong) throws Exception {
return oldString + "\n" + aLong;
}
}).toObservable();
}
})