Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Looking Ahead To RxJava 2 (Droidcon NYC 2016)

Looking Ahead To RxJava 2 (Droidcon NYC 2016)

Development on the next major version of RxJava is underway. While the operators remain largely unchanged, Observable creation, subscription management, and backpressure has been completely overhauled in this new version. This talk will be an exploration on not only what has changed but also the reasons behind why these changes were made. We'll also talk about how both libraries and applications can migrate to supporting RxJava 2 as well as interop between the two versions. No prior knowledge of RxJava is strictly required, although concepts, terms, and comparisons will be made that do assume some prior knowledge.

Video: soon

Jake Wharton

September 29, 2016
Tweet

More Decks by Jake Wharton

Other Decks in Programming

Transcript

  1. Reactive Streams ...is an initiative to provide a standard for

    asynchronous stream processing with non-blocking back pressure.
  2. Reactive Streams interface Publisher<T> {
 void subscribe(Subscriber<? super T> s);


    }A interface Subscriber<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 }B
  3. Reactive Streams interface Publisher<T> {
 void subscribe(Subscriber<? super T> s);


    }A interface Subscriber<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B
  4. Reactive Streams interface Publisher<T> {
 void subscribe(Subscriber<? super T> s);


    }A interface Subscriber<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Subscription {
 void request(long n);
 void cancel();
 }C
  5. Reactive Streams interface Publisher<T> {
 void subscribe(Subscriber<? super T> s);


    }A interface Subscriber<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Subscription {
 void request(long n);
 void cancel();
 }C interface Processor<T, R> extends Subscriber<T>, Publisher<R> {
 }D

  6. Reactive Streams class RxReactiveStreams {
 static <T> Publisher<T> toPublisher(Observable<T> o)

    { … }
 static <T> Observable<T> toObservable(Publisher<T> p) { … }
 static <T> Publisher<T> toPublisher(Single<T> o) { … }
 static <T> Single<T> toSingle(Publisher<T> p) { … }
 static <T> Publisher<T> toPublisher(Completable o) { … }
 static Completable toCompletable(Publisher<?> p) { … }
 }
  7. Reactive Streams class RxReactiveStreams {
 static <T> Publisher<T> toPublisher(Observable<T> o)

    { … }
 static <T> Observable<T> toObservable(Publisher<T> p) { … }
 static <T> Publisher<T> toPublisher(Single<T> o) { … }
 static <T> Single<T> toSingle(Publisher<T> p) { … }
 static <T> Publisher<T> toPublisher(Completable o) { … }
 static Completable toCompletable(Publisher<?> p) { … }
 } github.com/ReactiveX/RxJavaReactiveStreams
  8. Reactive Streams interface Subscriber<T> {
 void onNext(T t);
 void onComplete();


    void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B
  9. Reactive Streams interface Subscriber<T> {
 void onNext(T t);
 void onComplete();


    void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B Calling onSubscribe, onNext, onError or onComplete MUST return normally
  10. Reactive Streams interface Subscriber<T> {
 void onNext(T t);
 void onComplete();


    void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B Calling onSubscribe, onNext, onError or onComplete MUST return normally except when any provided parameter is null in which case it MUST throw a java.lang.NullPointerException to the caller
  11. Reactive Streams interface Subscriber<T> {
 void onNext(T t);
 void onComplete();


    void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B Calling onSubscribe, onNext, onError or onComplete MUST return normally except when any provided parameter is null in which case it MUST throw a java.lang.NullPointerException to the caller
  12. Flowable • Implementation of Reactive Streams Publisher. • Observed with

    Reactive Streams Subscriber. • 0 to many items, completes or errors. ALL NEW!!!!!
  13. Flowable • Implementation of Reactive Streams Publisher. • Observed with

    Reactive Streams Subscriber. • 0 to many items, completes or errors. • Handles backpressure to slow down events
 with Reactive Streams Subscription. ALL NEW!!!!!
  14. Flowable • Implementation of Reactive Streams Publisher. • Observed with

    Reactive Streams Subscriber. • 0 to many items, completes or errors. • Handles backpressure to slow down events
 with Reactive Streams Subscription. • Hundreds of convenience methods for
 transforming and composing data. ALL NEW!!!!!
  15. Flowable • Implementation of Reactive Streams Publisher. • Observed with

    Reactive Streams Subscriber. • 0 to many items, completes or errors. • Handles backpressure to slow down events
 with Reactive Streams Subscription. • Hundreds of convenience methods for
 transforming and composing data. ALL NEW!!!!!
  16. Flowable (aka RxJava 1.x's Observable) • Implementation of Reactive Streams

    Publisher. • Observed with Reactive Streams Subscriber. • 0 to many items, completes or errors. • Handles backpressure to slow down events
 with Reactive Streams Subscription. • Hundreds of convenience methods for
 transforming and composing data.
  17. Observable • Observed with an Observer (not Reactive Streams type).

    • 0 to many items, completes or errors. • No backpressure support. • Hundreds of convenience methods for transforming and
 composing data.
  18. Observable • Observed with an Observer (not Reactive Streams type).

    • 0 to many items, completes or errors. • No backpressure support. • Hundreds of convenience methods for transforming and
 composing data.
  19. Flowable vs. Observable • RxJava 1.x added backpressure late in

    the design process. • All types exposed backpressure but not all sources respected it.
  20. Flowable vs. Observable • RxJava 1.x added backpressure late in

    the design process. • All types exposed backpressure but not all sources respected it. • Backpressure, like inheritance, must be designed for.
  21. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e));
  22. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e));
  23. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e)); db.createQuery("SELECT * …") .subscribe(e -> update(e));
  24. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e)); db.createQuery("SELECT * …") .subscribe(e -> update(e));
  25. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e)); db.createQuery("SELECT * …") .subscribe(e -> update(e)); Observable<MotionEvent> Observable<Row>
  26. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e)); db.createQuery("SELECT * …") .subscribe(e -> update(e)); Observable<MotionEvent> Observable<Row> MissingBackpressureException
  27. Flowable vs. Observable • Backpressure, like inheritance, must be designed

    for. RxView.touches(paintView) .subscribe(e -> draw(e)); db.createQuery("SELECT * …") .subscribe(e -> update(e)); Observable<MotionEvent> Flowable<Row>
  28. Flowable vs. Observable Observable<MotionEvent> Flowable<Row> interface Subscriber<T> {
 void onNext(T

    t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Observer<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Disposable d);
 }B
  29. Flowable vs. Observable Observable<MotionEvent> Flowable<Row> interface Subscriber<T> {
 void onNext(T

    t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Observer<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Disposable d);
 }B interface Disposable {
 void dispose();
 }B interface Subscription {
 void cancel();
 void request(long r);
 }B
  30. Converting 1 2 3 4 5 6 7 8 9

    10 11 Observable
  31. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable toFlowable(DROP)X 1 2 3 4 5 request(5)
  32. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable toFlowable(DROP)X 1 2 3 4 5 request(5) request(2)
  33. Converting 1 2 3 4 5 6 7 8 9

    10 11 Observable Flowable toFlowable(DROP)X 1 2 3 4 5 9 10 request(5) request(2)
  34. Converting 1 2 3 4 5 Observable Flowable 1 2

    3 4 5 request(5) toFlowable(LATEST)X
  35. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) toFlowable(LATEST)X
  36. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) request(2) toFlowable(LATEST)X
  37. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) request(2) toFlowable(LATEST)X 8
  38. Converting 1 2 3 4 5 6 7 8 9

    10 11 Observable Flowable 1 2 3 4 5 9 request(5) request(2) toFlowable(LATEST)X 8
  39. Converting 1 2 3 4 5 Observable Flowable 1 2

    3 4 5 request(5) toFlowable(BUFFER)X
  40. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) toFlowable(BUFFER)X
  41. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) request(2) toFlowable(BUFFER)X
  42. Converting 1 2 3 4 5 6 7 8 Observable

    Flowable 1 2 3 4 5 request(5) request(2) toFlowable(BUFFER)X 6 7
  43. Converting 1 2 3 4 5 6 7 8 9

    10 11 Observable Flowable 1 2 3 4 5 request(5) request(2) toFlowable(BUFFER)X 6 7
  44. Converting 1 2 3 4 5 6 7 8 9

    10 11 Observable Flowable 1 2 3 4 5 request(Long.MAX_VALUE) 6 7 8 9 10 11 toObservable()
  45. Single • Either succeeds with an item or errors. •

    No backpressure support. • Convenience methods for transforming and composing data.
  46. Single • Either succeeds with an item or errors. •

    No backpressure support. • Convenience methods for transforming and composing data. • Think "reactive scalar".
  47. Completable • Either completes or errors. Has no items! •

    No backpressure support. • Convenience methods for transforming and composing data.
  48. Completable • Either completes or errors. Has no items! •

    No backpressure support. • Convenience methods for transforming and composing data. • Think "reactive runnable".
  49. Maybe • Either succeeds with an item, completes with no

    items, or errors. • No backpressure support. • Convenience methods for transforming
 and composing data. ALL NEW!!!!!
  50. Maybe • Either succeeds with an item, completes with no

    items, or errors. • No backpressure support. • Convenience methods for transforming
 and composing data. • Think "reactive optional". ALL NEW!!!!!
  51. Specializations • Encoding subsets of Observable into the type system.

    • Single – Item or error. Think "scalar". • Completable – Complete or error. Think "runnable". • Maybe – Item, complete, or error. Think "optional".
  52. Backpressure
 & Reactive Streams No Backpressure 0…n items, complete|error Flowable

    Observable item|complete|error Maybe item|error Single complete|error Completable Multicast FlowableProcessor Subject
  53. Operator Specialization 1 2 3 4 5 6 7 8

    9 10 11 first() 1 Observable Observable
  54. Operator Specialization 1 2 3 4 5 6 7 8

    9 10 11 first() 1 Observable Single
  55. Operator Specialization 1 2 3 4 5 6 7 8

    9 ignoreElements() Observable Completable
  56. Operator Specialization 1 2 3 4 5 6 7 8

    9 ignoreElements() Flowable Completable
  57. Flowable Observable Maybe Single Completable Flowable toObservable() reduce() elementAt() firstElement()

    lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Observable toFlowable() reduce() elementAt() firstElement() lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Maybe toFlowable() toObservable() toSingle() sequenceEqual() toCompletable() Single toFlowable() toObservable() toMaybe() toCompletable() Completable toFlowable() toObservable() toMaybe() toSingle() toSingleDefault() From To
  58. Flowable Observable Maybe Single Completable Flowable toObservable() reduce() elementAt() firstElement()

    lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Observable toFlowable() reduce() elementAt() firstElement() lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Maybe toFlowable() toObservable() toSingle() sequenceEqual() toCompletable() Single toFlowable() toObservable() toMaybe() toCompletable() Completable toFlowable() toObservable() toMaybe() toSingle() toSingleDefault() From To
  59. Flowable Observable Maybe Single Completable Flowable toObservable() reduce() elementAt() firstElement()

    lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Observable toFlowable() reduce() elementAt() firstElement() lastElement() singleElement() scan() elementAt() first()/firstOrError() last()/lastOrError() single/singleOrError() all()/any()/count() (and more) ignoreElements() Maybe toFlowable() toObservable() toSingle() sequenceEqual() toCompletable() Single toFlowable() toObservable() toMaybe() toCompletable() Completable toFlowable() toObservable() toMaybe() toSingle() toSingleDefault() From To
  60. Creating Sources String[] array = { "Hello", "World" };
 List<String>

    list = Arrays.asList(array);
 Flowable.fromArray(array); Flowable.fromIterable(list); Observable.fromArray(array); Observable.fromIterable(list);
  61. Creating Sources OkHttpClient client = // … Request request =

    // … Observable.fromCallable(new Callable<String>() {
 @Override public String call() throws Exception {Y
 return client.newCall(request).execute();Z
 }X
 }); 
 
 getName()
  62. Creating Sources Flowable.fromCallable(() -> "Hello");
 
 Observable.fromCallable(() -> "Hello");
 


    Maybe.fromCallable(() -> "Hello");
 Maybe.fromAction(() -> System.out.println("Hello"));
 Maybe.fromRunnable(() -> System.out.println("Hello"))
 
 Single.fromCallable(() -> "Hello");
 
 Completable.fromCallable(() -> "Ignored!");
 Completable.fromAction(() -> System.out.println("Hello"));
 Completable.fromRunnable(() -> System.out.println("Hello"));
  63. Creating Sources Observable.create(e -> {
 e.onNext("Hello");
 e.onComplete();
 }); new ObservableOnSubscribe<String>()


    @Override
 public void subscribe(ObservableEmitter<String> ) throws Exception {
 
 
 }X

  64. Creating Sources OkHttpClient client = // … Request request =

    // … Observable.create(e -> { client.newCall(request).enqueue(new Callback() { @Override public void onResponse(Response r) throws IOException { e.onNext(r.body().string()); e.onComplete(); }A @Override public void onFailure(IOException e) { e.onError(e); }B });
 }); 
 e.onNext("Hello"); e.onNext("World");
 e.onComplete();
  65. Creating Sources OkHttpClient client = // … Request request =

    // … Observable.create(e -> { Call call = client.newCall(request); call.enqueue(new Callback() { @Override public void onResponse(Response r) throws IOException { e.onNext(r.body().string()); e.onComplete(); }A @Override public void onFailure(IOException e) { e.onError(e); }B });
 });
  66. Creating Sources OkHttpClient client = // … Request request =

    // … Observable.create(e -> { Call call = client.newCall(request); e.setCancelation(() -> call.cancel()); call.enqueue(new Callback() { @Override public void onResponse(Response r) throws IOException { e.onNext(r.body().string()); e.onComplete(); }A @Override public void onFailure(IOException e) { e.onError(e); }B });
 });
  67. Creating Sources OkHttpClient client = // … Request request =

    // … Observable.create(e -> { Call call = client.newCall(request); e.setCancelation(() -> call.cancel()); call.enqueue(new Callback() { @Override public void onResponse(Response r) throws IOException { e.onNext(r.body().string()); e.onComplete(); }A @Override public void onFailure(IOException e) { e.onError(e); }B });
 });
  68. Creating Sources View view = // … Observable.create(e -> {

    e.setCancelation(() -> view.setOnClickListener(null)); view.setOnClickListener(v -> e.onNext(v));
 }); OkHttpClient client = // ... Request request = // ... Call call = client.newCall(request); e.setCancelation(() -> call.cancel()); call.enqueue(new Callback() { @Override public void onResponse(Response r) throws IOException { e.onNext(r.body().string()); e.onComplete(); }A @Override public void onFailure(IOException e) { e.onError(e); }B });

  69. Creating Sources Flowable.create(e -> { … }); Observable.create(e -> {

    … }); Maybe.create(e -> { … }); Single.create(e -> { … }); Completable.create(e -> { … });
  70. Observing Sources Observable<String> Flowable<String> interface Subscriber<T> {
 void onNext(T t);


    void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Observer<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Disposable d);
 }B
  71. Observing Sources Observable<String> Flowable<String> interface Subscriber<T> {
 void onNext(T t);


    void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Observer<T> {
 void onNext(T t);A
 void onComplete();B
 void onError(Throwable t);C
 void onSubscribe(Disposable d);D
 }B interface Disposable {
 void dispose();
 }B interface Subscription {
 void cancel();
 void request(long r);
 }B
  72. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribe(new Observer<String>() {
 @Override

    public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … } 
 @Override public void onSubscribe(Disposable d) { ??? }B
 }); Flowable<String> interface Subscriber<T> {
 void onNext(T t);
 void onComplete();
 void onError(Throwable t);
 void onSubscribe(Subscription s);
 }B interface Disposable {
 void dispose();
 }B interface Subscription {
 void cancel();
 void request(long r);
 }B interface T
 T t ;A
 ;B
 ;C
 ;D

  73. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribe(new DisposableObserver<String>() {
 @Override

    public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 }); 
 
 
 
 @Override public void onSubscribe(Disposable d) { ??? }B

  74. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribe(new DisposableObserver<String>() {
 @Override

    public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z unsubscribe???
  75. Observing Sources Observable<String> o = Observable.just("Hello"); DisposableObserver observer = new

    DisposableObserver<String>() {
 @Override public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 } o.subscribe(observer);Z unsubscribe???
  76. Observing Sources Observable<String> o = Observable.just("Hello"); DisposableObserver observer = new

    DisposableObserver<String>() {
 @Override public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 } o.subscribe(observer);Z observer.dispose();
  77. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribe(new DisposableObserver<String>() {
 @Override

    public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z
  78. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribeWith(new DisposableObserver<String>() {
 @Override

    public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z
  79. Observing Sources Observable<String> o = Observable.just("Hello"); Disposable d = o.subscribeWith(new

    DisposableObserver<String>() {
 @Override public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z d.dispose();
  80. Observing Sources Observable<String> o = Observable.just("Hello"); CompositeDisposable disposables = new

    CompositeDisposable(); Disposable d = o.subscribeWith(new DisposableObserver<String>() {
 @Override public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z disposables.add(d); 
 
 
 
 d.dispose();
  81. Observing Sources Observable<String> o = Observable.just("Hello"); CompositeDisposable disposables = new

    CompositeDisposable(); Disposable d = o.subscribeWith(new DisposableObserver<String>() {
 @Override public void onNext(String s) { … }
 @Override public void onComplete() { … }
 @Override public void onError(Throwable t) { … }
 });Z disposables.add(d); disposables.dispose();
  82. Observing Sources Observable<String> o = Observable.just("Hello"); o.subscribeWith(new DisposableObserver<String>() { …

    });Z Maybe<String> m = Maybe.just("Hello"); m.subscribeWith(new DisposableMaybeObserver<String>() { … });Z Single<String> s = Single.just("Hello"); s.subscribeWith(new DisposableSingleObserver<String>() { … });Z Completable c = Completable.completed(); c.subscribeWith(new DisposableCompletableObserver<String>() { … });Z
  83. Observing Sources Flowable<String> f = Flowable.just("Hello"); f.subscribeWith(new DisposableSubscriber<String>() { …

    }); Observable<String> o = Observable.just("Hello"); o.subscribeWith(new DisposableObserver<String>() { … }); Maybe<String> m = Maybe.just("Hello"); m.subscribeWith(new DisposableMaybeObserver<String>() { … }); Single<String> s = Single.just("Hello"); s.subscribeWith(new DisposableSingleObserver<String>() { … }); Completable c = Completable.completed(); c.subscribeWith(new DisposableCompletableObserver<String>() { … });
  84. Observing Sources Flowable<String> f = Flowable.just("Hello"); f.subscribeWith(new DisposableSubscriber<String>() { …

    }); Observable<String> o = Observable.just("Hello"); o.subscribeWith(new DisposableObserver<String>() { … }); Maybe<String> m = Maybe.just("Hello"); m.subscribeWith(new DisposableMaybeObserver<String>() { … }); Single<String> s = Single.just("Hello"); s.subscribeWith(new DisposableSingleObserver<String>() { … }); Completable c = Completable.completed(); c.subscribeWith(new DisposableCompletableObserver<String>() { … });
  85. Observing Sources Flowable<String> f = Flowable.just("Hello"); Disposable d1 = f.subscribeWith(new

    DisposableSubscriber<String>() { … }); Observable<String> o = Observable.just("Hello"); Disposable d2 = o.subscribeWith(new DisposableObserver<String>() { … }); Maybe<String> m = Maybe.just("Hello"); Disposable d3 = m.subscribeWith(new DisposableMaybeObserver<String>() { … }); Single<String> s = Single.just("Hello"); Disposable d4 = s.subscribeWith(new DisposableSingleObserver<String>() { … }); Completable c = Completable.completed(); Disposable d5 = c.subscribeWith(new DisposableCompletableObserver<String>() { … });
  86. RxJava • 2.0.0-RC3 was released 2016-09-23. • Releases are more

    like developer previews than release candidates.
  87. RxJava • 2.0.0-RC3 was released 2016-09-23. • Releases are more

    like developer previews than release candidates. • Next two are scheduled for 2016-10-07 and 2016-10-21.
  88. RxJava • 2.0.0-RC3 was released 2016-09-23. • Releases are more

    like developer previews than release candidates. • Next two are scheduled for 2016-10-07 and 2016-10-21. • Final release scheduled for 2016-10-29.
  89. RxJava • Package name is io.reactivex.*. • Maven coordinates are

    io.reactivex.rxjava2:rxjava. • Why the change? See http://jakes.link/major-versions
  90. RxAndroid • 2.0.0-RC1 was released 2016-08-25. • Provides facilities for

    dealing with the main thread (or any Looper). • Package name is io.reactivex.android.*.
  91. RxAndroid • 2.0.0-RC1 was released 2016-08-25. • Provides facilities for

    dealing with the main thread (or any Looper). • Package name is io.reactivex.android.*. • Maven coordinates are io.reactivex.rxjava2:rxandroid.
  92. Living with 1.x and 2.x class RxJavaInterop {
 static <T>

    Flowable<T> toV2Flowable(rx.Observable<T> o) { … }
 static <T> Observable<T> toV2Observable(rx.Observable<T> o) { … } static <T> Maybe<T> toV2Maybe(rx.Single<T> s) { … } static <T> Maybe<T> toV2Maybe(rx.Completable c) { … }
 static <T> Single<T> toV2Single(rx.Single<T> s) { … }
 static Completable toV2Completable(rx.Completable c) { … } 
 static <T> rx.Observable<T> toV1Observable(Publisher<T> p) { … } static <T> rx.Observable<T> toV1Observable(Observable<T> o, …) { … }
 static <T> rx.Single<T> toV1Single(Single<T> o) { … } static <T> rx.Single<T> toV1Single(Maybe<T> m) { … }
 static rx.Completable toV1Completable(Completable c) { … } static rx.Completable toV1Completable(Maybe<T> m) { … }
 }X
  93. Living with 1.x and 2.x class RxJavaInterop {
 static <T>

    Flowable<T> toV2Flowable(rx.Observable<T> o) { … }
 static <T> Observable<T> toV2Observable(rx.Observable<T> o) { … } static <T> Maybe<T> toV2Maybe(rx.Single<T> s) { … } static <T> Maybe<T> toV2Maybe(rx.Completable c) { … }
 static <T> Single<T> toV2Single(rx.Single<T> s) { … }
 static Completable toV2Completable(rx.Completable c) { … } 
 static <T> rx.Observable<T> toV1Observable(Publisher<T> p) { … } static <T> rx.Observable<T> toV1Observable(Observable<T> o, …) { … }
 static <T> rx.Single<T> toV1Single(Single<T> o) { … } github.com/akarnokd/RxJava2Interop
  94. Other Libraries We Control • Retrofit 2 – github.com/JakeWharton/retrofit2-rxjava2-adapter/ •

    RxBinding – waiting for 2.0 final • RxRelay – waiting for 2.0 final • RxReplayingShare – waiting for 2.0 final • SQL Brite – waiting for 2.0 final • Whorlwind – waiting for 2.0 final
  95. RxJava 2 • Reactive Streams compliant. • Backpressure in the

    type system (Flowable). • New Maybe type.
  96. RxJava 2 • Reactive Streams compliant. • Backpressure in the

    type system (Flowable). • New Maybe type. • Actually usable create().
  97. RxJava 2 • Reactive Streams compliant. • Backpressure in the

    type system (Flowable). • New Maybe type. • Actually usable create(). • All the same operators.
  98. RxJava 2 • Reactive Streams compliant. • Backpressure in the

    type system (Flowable). • New Maybe type. • Actually usable create(). • All the same operators. • Preview releases now, final release in a month.