Skip to content

Instantly share code, notes, and snippets.

@NiteshKant
Created November 5, 2015 07:33
Show Gist options
  • Select an option

  • Save NiteshKant/0cd350faee7d82b31913 to your computer and use it in GitHub Desktop.

Select an option

Save NiteshKant/0cd350faee7d82b31913 to your computer and use it in GitHub Desktop.

Revisions

  1. NiteshKant created this gist Nov 5, 2015.
    12 changes: 12 additions & 0 deletions Pager.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import rx.Observable;

    public class Pager {

    public static void main(String[] args) {
    Observable.range(1, 1000)
    .window(10)
    .doOnNext(nextBatch -> System.out.println("Next page."))
    .flatMap(nums -> nums, 1)
    .forEach(System.out::println);
    }
    }