GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 21 · 6 min readChapter 30 : UseCase27 - Flow Cancellation & Cooperative Cancellation Flow cancellation is not an optional feature. It is a core part of how coroutines are designed to behave. When a collector stops collecting, the entire upstream flow is cancelled automatically. This i00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 21 · 4 min readChapter 29 : UseCase26 - Channels and Flow BridgeNow we do one level below Flow. Flow is built on coroutines.Coroutines are built on channels. Here we convert channel to Flow and build Flow using channelFlow. We also understand producer-consumer in 00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 20 · 3 min readChapter 27 : UseCase24 - StateFlow (State Holder Semantics)What is StateFlow? StateFlow is a special type of SharedFlow that: Always holds a current value Requires an initial value Replays the latest value to new collectors Conflates updates automatically00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 18 · 3 min readChapter 24 : UseCase21 - Conflation Deep Divebuffer() in Chapter 23 was all about “queue everything” when the consumer is slow. Now we look into conflate() which is all about “dropping intermediate values” and caring only about the latest value. The Core Idea When the consumer is slow: buffer(...00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 16 · 3 min readChapter 21 : UseCase18 - Exception Handling in FlowFlow gives us structured exception handling. Business Scenario We will: Process stocks Throw an artificial exception for demonstration Handle it safely using catch Continue flow gracefully Code Implementation package org.kotlinflowlearner.stock...00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Feb 15 · 4 min readChapter 20 : UseCase17 - zipIn this chapter we will use zip() for synchronised business streams. Business Scenario We want to: Take top N stocks by market cap Take top N stocks by price Pair them position-wise Produce a comp00
ABAjimsimbom Bong Minblog.ajim.dev·Jan 31 · 5 min readKotlin FundamentalsKotlin is a statically typed multi-paradigm programming language developed by JetBrains and runs on the Java Virtual Machine (JVM). Kotlin is the official language for developing Android applications and also has use cases in other areas like server-...00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Jan 29 · 4 min readChapter 15 : UseCase12 - combine()combine() merges two flows. But unlike zip(), it does not wait for matching pairs. Instead, whenever either flow emits, combine uses the latest value from both flows. This makes it reactive and contin00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Jan 28 · 3 min readChapter 14 : UseCase11 - zip()In this chapter we are learning how to combine two flows pair-by-pair. zip() waits for: One value from Flow A One value from Flow B Then combine them. They move in sync. If one is slower, then it 00
GRGanesh Rama Hegdeinkotlinflow.hashnode.dev·Jan 18 · 5 min readChapter 4 : UseCase01 - Cold Flow BasicsCold Flow : Understanding Laziness and Execution We now have a fully validated in-memory dataset: List<Stock> We will now understand Kotlin Flow from first principles. In this chapter our focus will b00