Java 9 Flow API: ordered merge
IntroductionSometimes, one has several ordered sequences of events and would like to merge them into one single flow. Since one element from a sequence should come before another element in another...
View ArticleInteroperation between RxJava and Kotlin Coroutines
IntroductionWriting imperative-looking code with Kotlin Coroutines is certainly an attractive property of it, but I'd think things can get quite convoluted pretty fast once, for example, Selectors are...
View ArticleJava 9 Flow API: switching threads
IntroductionEnsuring certain computations happen on the right thread, usually off the main thread, is a very common development task when dealing with reactive flows. When building up tools for Java...
View ArticleJava 9 Flow API: timing out events
IntroductionOne of the main properties of reactive programming is that the events may arrive over time instead of immediately available to a consumer. In traditional Future-based programming, one could...
View ArticleJava 9 Flow API: arbitration and concatenation
IntroductionA very common task is to combine multiple sources, or more generally, start consuming a source once the previous source has terminated. The naive approach would be to simply call...
View ArticleJava 9 Flow API: taking and skipping
IntroductionLimiting or skipping over parts of a flow is a very common task: either we are only interested in the first N items or we don't care about the first N items. Sometimes, N is unknown but we...
View ArticleAndroid LiveData API: a quick look
IntroductionThreading and lifecycle are one of the top concerns when developing applications for the Android platform. UI has to be interacted with on a dedicated thread (main thread) but in order to...
View ArticleWhen multiple subscribeOn()s do have effect
IntroductionIn many tutorials and explanations, it has been said that having multiple subscribeOn()s has no effect and only the one closest to the source wins. I often tell this with the wording "no...
View ArticleJava 9 Flow API: Multicasting via a Processor
IntroductionThere are situations when the same elements of a source should be dispatched to multiple consumers. Certainly, if the source supports multiple subscribers and is deterministic (such as our...
View Article