A stream of events using the observer pattern
Hot Observables
Cold Observables
emit whether you are ready or not
emit when subscribed to
emit whether you are ready or not
Examples:
Examples:
Subjects
Observables
----------------
Disposables
Threading
Not disposing subscriptions leads to memory leaks
Android can kill your app at anytime - what happens with subjects then
If multiple observers subscribe to a given observable, how do you handle concurrency?
Not knowing RX operators can lead to a real mess reinventing the wheel over and over again
Can easily construct OkHttpClient instances of already existing ones
Shares an in-memory map to different routes as long as the base instance remains the same
Most used in Android, HTTP/2 support, connection pools, caching, GZIP encoding etc.
AuthLibrary is from stone age - using AsyncTasks, not updated for a long time (only docs)
Audio player can use OkHttp but currently, when used, it works slow and buggy
Not easy to see how many API classes we have and make sure they also use the same shared OkHttp instance
OkHttp everywhere
Proper architecture to manage RxJava disposables and avoid memory leaks
Remove subjects unless really necessary
Move away from RxJava to coroutines
Replace Auth library with the Android built-in