Migrating from Rx to Coroutines — Tinkoff Mobile's Experience
summary
A Kotlin engineering team at Tinkoff Mobile describes migrating their 2-year-old app from Rx (ReactiveX) to Kotlin coroutines. The talk covers why Rx was often excessive for their multithreading needs, how they experimented with coroutines in a small test app, and then rolled out a full migration across a large codebase without halting main feature development, sharing practical problems encountered and benefits gained from running coroutines in production for over two years.
AI-written summary · about
chapters (37)
- 0:00Introduction and speaker background
- 2:15Project overview and motivation
- 4:45Why switch from Rx to Coroutines
- 5:26Key Coroutines concepts explained
- 6:09Choosing the first migration target
- 6:52Setting up Coroutines in the project
- 8:17Updating Retrofit and Room interfaces
- 9:20Rewriting repository layer code
- 10:24Maintaining backward compatibility
- 11:05Handling background operations and dispatchers
- 12:09Replacing Java synchronization
- 13:13Common pitfalls and async misconceptions
- 14:13Using Coroutines in the presentation layer
- 15:17Error handling in Coroutines
- 16:43Exception handler scope limitations
- 17:07SupervisorJob for isolated coroutines
- 18:08Using try-catch with Coroutines
- 19:14When not to use try-catch
- 19:58Testing and debugging Coroutines
- 20:39Migration timeline and team involvement
- 21:20Post-migration results and benefits
- 22:46Handling edge cases and team consensus
- 23:28Negative experience: CancellationException issues
- 24:54Fixing CancellationException leaks
- 25:58Detecting CancellationException in code
- 26:40Converting callback-based libraries
- 27:42Example: Android Animator integration
- 28:47Advantages of async animation with Coroutines
- 29:31Custom Coroutines builder syntax
- 31:41Flexible Coroutines syntax design
- 32:46Coroutines vs Rx: final comparison
- 33:48Mental barriers to migration
- 34:54Team and candidate attraction benefits
- 35:34Conclusion and call to action
- 36:59Q&A: Flow vs Coroutines
- 37:23Q&A: Fatal errors after migration
- 38:46Q&A: Performance impact
