Slide 1

Slide 1 text

Taking Glance at RxJava 2.0 shaunkawano

Slide 2

Slide 2 text

Taking Glance at RxJava 2.0 • Differences between 1.x and 2.x? • Schedule for RxJava 2.0 Release • Up-To-Date with RxJava 2.0 • Conclusion (Android-Focused, no sample code or live coding)

Slide 3

Slide 3 text

RxJava 2.0 • Following Reactive Streams Specification
 Goal : asynchronous streams of data with non-blocking back pressure
 Scope : achieving the above goal with minimal set of interfaces and methods • Following Java 8 Naming Convention • Some breaking changes, some backward compatibles http://www.reactive-streams.org https://github.com/ReactiveX/RxJava/wiki/Reactive-Streams

Slide 4

Slide 4 text

Differences between 1.x and 2.x? https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)

Slide 5

Slide 5 text

Differences between 1.x and 2.x? (1) • Package Renaming
 io.reactivex.rxjava:1.x.y -> io.reactivex.rxjava:rxjava:2.x.y • io.reactivex.Observable becomes NOT back pressured • io.reactivex.Flowable WILL BE back pressured https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#observable-and-flowable https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#maven-address-and-base-package

Slide 6

Slide 6 text

Differences between 1.x and 2.x? (2) • Action0 -> java.lang.Runnable • Action1 -> Consumer, Action2 -> BiConsumer • ActionN -> Consumer https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#actions

Slide 7

Slide 7 text

Differences between 1.x and 2.x? (3) • Func3~Func9 → Function3 ~ Function9 • FuncN → FuncN • Func1 → Predicate https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#functions

Slide 8

Slide 8 text

Differences between 1.x and 2.x? (4) .subscribe() method no longer returns Subscription rx.Subscription → io.reactivex.Disposable https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#subscriber

Slide 9

Slide 9 text

AsyncSubscriber subscriber = new AsyncSubscriber() { @Override public void onStart() { request(Long.MAX_VALUE); } @Override public void onNext(Integer t) { System.out.println(t); } @Overrides public void onError(Throwable t) { t.printStackTrace(); } @Override public void onComplete() { System.out.println("Done"); } }; Flowable.range(1, 10).delay(1, TimeUnit.SECONDS).subscribe(subscriber); subscriber.dispose(); https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#subscriber

Slide 10

Slide 10 text

AsyncSubscriber subscriber = new AsyncSubscriber() { @Override public void onStart() { request(Long.MAX_VALUE); } @Override public void onNext(Integer t) { System.out.println(t); } @Overrides public void onError(Throwable t) { t.printStackTrace(); } @Override public void onComplete() { System.out.println("Done"); } }; Flowable.range(1, 10).delay(1, TimeUnit.SECONDS).subscribe(subscriber); subscriber.dispose(); https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0-(draft)#subscriber

Slide 11

Slide 11 text

And more, and more.

Slide 12

Slide 12 text

Schedule for Rx Java 2.0 Release

Slide 13

Slide 13 text

Schedule for Rx Java 2.0 Release • In the next 2 weeks: 1st developer preview 
 (Not stable for production yet) • 3 ~ 4 more preview releases and, • Release: Middle of October http://fragmentedpodcast.com/episodes/053-jake-wharton-on-rxjava-2

Slide 14

Slide 14 text

Up-To-Date with RxJava 2.0

Slide 15

Slide 15 text

Up-To-Date with RxJava 2.0 • Check out RxJava GitHub Repository
 - Wiki
 - 2.x Branch • Fragmented Podcast 053: Jake Wharton on RxJava (2) • Droidcon NYC 2016 (Paid Live Stream) http://fragmentedpodcast.com/episodes/053-jake-wharton-on-rxjava-2 http://droidcon.nyc

Slide 16

Slide 16 text

Can We Start Using It NOW?

Slide 17

Slide 17 text

Retrofit2 RxJava2 Adapter https://github.com/JakeWharton/retrofit2-rxjava2-adapter

Slide 18

Slide 18 text

Available types: • Observable, Observable>, and Observable> where T is the body type. • Flowable, Flowable> and Flowable> where T is the body type. • Single, Single>, and Single> where T is the body type. Retrofit2 RxJava2 Adapter https://github.com/JakeWharton/retrofit2-rxjava2-adapter

Slide 19

Slide 19 text

Conclusion

Slide 20

Slide 20 text

Conclusion Let’s get ready for RxJava 2.0 and develop Android apps easier and happier!

Slide 21

Slide 21 text

Taking Glance at RxJava 2.0 shaunkawano fin.