
Explore the basics of RxJava 3 and reactive programming through two sections: core concepts and practical Java examples on the JVM, including server-side use.
Explore functional reactive programming by combining pure, stateless functions with asynchronous event handling using reactive extensions such as RxJava and observables, enabling sequence or parallel processing and callback-based results.
Explore the observer design pattern as the foundation of RxJava, with observable and observer roles, registering observers, and notifying changes to enable functional reactive programming and multithreading.
Explore RxJava JavaDocs with marble diagrams to visualize how observables, operators like map, flatMap, zip, and filter transform streams, handle errors, and schedule work on the computation scheduler.
Compare RxJava with standard Java streams by applying map and filter to a string list, converting to integers, and showing similar outputs and marble diagrams that illustrate the behavior.
Explore hot versus cold observables in RxJava, comparing push-based hot streams with pull-based cold streams, and see how onNext, onComplete, and onError govern emission and errors and network requests.
Explore the difference between subscribeOn and observeOn in RxJava, showing how subscribeOn changes the execution thread for the whole chain via a computation scheduler, with logs of each step.
Learn how observeOn and subscribeOn control threading in RxJava, switching execution to a computation or Android main thread via schedulers, and applying observeOn to downstream operations only.
Explore how subscribeOn and observeOn shift execution threads in RxJava by running an example with two events. See how upstream and downstream work can run on the same RxComputationThreadPool thread.
Compare standard Java streams parallel processing with RxJava, showing how flatMap and subscribeOn run per-item work on separate threads and then merge results with blockingSubscribe.
Explore RxJava schedulers that control which threads run your code, using subscribeOn and observeOn, with examples of computation, IO, newThread, trampoline, and a custom executor-based scheduler.
Learn how errors propagate through an RxJava pipeline, triggering onError and skipping downstream steps, and how onErrorResumeNext enables recovery with fallback data.
See how back pressure is handled in RxJava by converting observables to Flowable with toFlowable and applying strategies like buffer, drop, latest, and error to manage unconsumed events.
Compare how RxJava backpressure strategies manage overflow—buffer, missing, drop, and latest—using onError and onCompleted handlers to prevent memory issues and complete normally.
Demonstrates using Flowable.generate to create a backpressure aware generator that emits values on demand, with request signaling governing onNext, onComplete, and a safe internal buffer.
Learn to test RxJava observables with a test observer, asserting results, no errors, and completion, including multi-threaded scenarios using TestScheduler and interval with zipWith.
Use RxJava's PublishSubject to implement a single event bus that broadcasts type-filtered events to registered observers via onNext, enabling decoupled, asynchronous UI updates and easy disposal.
Learn how to build efficient incremental text search with RxJava by applying debounce to user input to reduce network requests, switching threads with observeOn, and using computation and IO schedulers.
Explore implementing a simple RxJava cache with replay via a connectable observable to share a single subscription and replay results to future observers, including cache size and time window eviction.
Explore how to implement timeouts and retries for network requests with RxJava by using observable streams, timeout operators, and a retry policy on errors.
Explore how RxJava orchestrates chained and parallel network requests, using observable from supplier, map, flatMap, and zip to combine results, with centralized error handling via handleError.
Build a periodically refreshed cache in RxJava using a connectable observable and replay, with interval-driven refresh and an atomic reference to swap caches every few seconds.
Implement a backoff strategy for rate-limited APIs using RxJava's retryWhen, with exponential delays and a retry sequence. Explore how range and timer generate delays, and how lastOrError handles exhausted retries.
Master RxJava basics and its use cases while exploring reactive extensions and functional reactive programming principles. Write more reliable, responsive, and performant code.
Functional Reactive Programming (FRP) is a different programming paradigm, just like Object Oriented Programming. It has gotten traction in the recent years where more and more technology adopt it for building responsive, reliable and maintainable systems. Writing multithreading code is usually difficult because you need to think how several pieces move at the same time and work together.
In this course I'll teach you RxJava, the Java implementation of Reactive Extensions to write safe, reliable multithreading code. It's being heavily in use in Android applications, but this course presents RxJava concepts in a generic way. You don't need to know anything about Android to use this course, learn and use RxJava in any kind of Java application.
You will learn how RxJava compares with Java standard library for writing multithreading code, and the parallel streams introduced in Java 8. In the section about use cases, I present you some examples of how RxJava solves particular challenges, so you can get started quickly. This course is meant to serve as a quick reference, the section about use cases doesn't follow a particular order, so you can skip and come back to lectures as you see fit.
The concepts you learn here will also help you understand other libraries that were inspired by Reactive Extensions.
(Music: bensound)