Skip to content

Instantly share code, notes, and snippets.

@CoderJava
Created October 2, 2018 02:41
Show Gist options
  • Select an option

  • Save CoderJava/860e39a44be318039bc8af8ae19f9853 to your computer and use it in GitHub Desktop.

Select an option

Save CoderJava/860e39a44be318039bc8af8ae19f9853 to your computer and use it in GitHub Desktop.
Transforming Operator Window RxJava
public class RxTransformingOperatorWindow {
public static void main(String[] args) {
Observable.range(1, 10)
.window(3)
.subscribe(longObservable -> {
System.out.println("starting new window");
longObservable.subscribe(aLong -> System.out.println("window item " + aLong),
throwable -> System.out.println("window error"),
() -> System.out.println("window completed")
);
}, throwable -> System.out.println("onError"),
() -> System.out.println("onCompleted"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment