Skip to content

Instantly share code, notes, and snippets.


Suganthan Madhavan Pillai msuganthan

View GitHub Profile
View Some Rx-Java
List<Set<String>> sets = Observable.fromIterable(searchResults)
.flatMap(searchResult -> Observable.just(searchResult))
.map(link -> pageInspector.inspect(link, TIMEOUT))
Map<String, Long> collect =
.collect(groupingBy(Function.identity(), counting()));
View RxJava- Achieving Parallelization
public static void main(String[] args) throws Exception{
Observable<Integer> vals = Observable.range(1,100);
vals.flatMap(val -> Observable.just(val)
.map(i -> intenseCalculation(i))
).toList().subscribe(val -> System.out.println("Subscriber received "
+ val + " on "
+ Thread.currentThread().getName()));
You can’t perform that action at this time.