Instacart Jun 21, 2017

RxJava 1 -> RxJava 2 (Disposing Subscriptions)

Article Summary

Migrating from RxJava 1 to RxJava 2? The biggest gotcha isn't what you think—it's how you dispose of subscriptions.

Instacart engineer Kaushik Gopal breaks down the trickiest part of the RxJava 2 migration: managing subscription lifecycles. The Reactive Streams spec changed everything about how you prevent memory leaks in Android apps.

Key Takeaways

Critical Insight

RxJava 2's Reactive Streams compliance broke the old subscription pattern, but DisposableSubscriber and subscribeWith() restore the convenience Android devs need for lifecycle management.

The article reveals a critical difference between .clear() and .dispose() that could break your entire subscription management strategy.

Recent from Instacart

Related Articles