---
title: "#coroutines articles | Hashnode"
description: "Explore 193 articles tagged #coroutines on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/coroutines"
---

Tag

# #coroutines

193 posts · 35 followers

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/same-thread-different-moment-what-dispatchers-main-immediate-really-changes/6af4b20c393d93faac86ed76)

### [Same Thread, Different Moment: What Dispatchers.Main.immediate Really Changes](https://android-expert.hashnode.dev/same-thread-different-moment-what-dispatchers-main-immediate-really-changes?utm_source=hashnode&utm_medium=feed)

Both run on Android’s main thread, but one queues your coroutine and the other starts it now. Here is what breaks when you forget.

13 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/same-thread-different-moment-what-dispatchers-main-immediate-really-changes?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/race-queue-or-cancel-choosing-the-right-flatmap-for-your-kotlin-flow/6af4b2049a2d1c1322f07ec6)

### [Race, Queue, or Cancel: Choosing the Right flatMap for Your Kotlin Flow](https://android-expert.hashnode.dev/race-queue-or-cancel-choosing-the-right-flatmap-for-your-kotlin-flow?utm_source=hashnode&utm_medium=feed)

How flatMapMerge, flatMapConcat and flatMapLatest differ on the same input, and the production failure modes each one hides.

12 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/race-queue-or-cancel-choosing-the-right-flatmap-for-your-kotlin-flow?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/six-builders-one-mental-model-choosing-the-right-kotlin-coroutine-builder-in-a-production/6af4b1fea4540f825fe11d7f)

### [Six Builders, One Mental Model: Choosing the Right Kotlin Coroutine Builder in a Production Android App](https://android-expert.hashnode.dev/six-builders-one-mental-model-choosing-the-right-kotlin-coroutine-builder-in-a-production?utm_source=hashnode&utm_medium=feed)

How launch, async, runBlocking, coroutineScope, supervisorScope and withContext differ, and the production failure modes that bite.

17 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/six-builders-one-mental-model-choosing-the-right-kotlin-coroutine-builder-in-a-production?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/why-your-compose-tests-started-failing-the-v2-test-dispatcher-explained/6af4b1f78f5cb6bd751faa09)

### [Why Your Compose Tests Started Failing: The v2 Test Dispatcher Explained](https://android-expert.hashnode.dev/why-your-compose-tests-started-failing-the-v2-test-dispatcher-explained?utm_source=hashnode&utm_medium=feed)

A one-line import change moved Compose tests to StandardTestDispatcher. Here’s what breaks, why, and how to fix a large suite safely.

18 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/why-your-compose-tests-started-failing-the-v2-test-dispatcher-explained?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/tracing-without-guesswork-closing-the-loop-between-your-laptop-profiler-and-a-stranger-s-pixel/6af4b1c0eb3b74e7aee7807c)

### [Tracing Without Guesswork: Closing the Loop Between Your Laptop Profiler and a Stranger’s Pixel](https://android-expert.hashnode.dev/tracing-without-guesswork-closing-the-loop-between-your-laptop-profiler-and-a-stranger-s-pixel?utm_source=hashnode&utm_medium=feed)

Connect androidx.tracing 2.0, macrobenchmarks, and ProfilingManager into one loop that ends “cannot reproduce” tickets for good.

13 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/tracing-without-guesswork-closing-the-loop-between-your-laptop-profiler-and-a-stranger-s-pixel?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/naming-the-callback-kotlin-fun-interface-without-the-production-scars/6af4b189eb3b74e7aee6f9b4)

### [Naming the Callback: Kotlin fun interface Without the Production Scars](https://android-expert.hashnode.dev/naming-the-callback-kotlin-fun-interface-without-the-production-scars?utm_source=hashnode&utm_medium=feed)

SAM conversion cuts the boilerplate, but leaks, re-entrancy, and API drift still bite. Six failure modes and the fixes for each.

12 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/naming-the-callback-kotlin-fun-interface-without-the-production-scars?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/one-turnstile-or-one-lane-mutex-vs-a-single-thread-executor-on-android/6af4b17d577c87e513371a67)

### [One Turnstile or One Lane? Mutex vs. a Single-Thread Executor on Android](https://android-expert.hashnode.dev/one-turnstile-or-one-lane-mutex-vs-a-single-thread-executor-on-android?utm_source=hashnode&utm_medium=feed)

One thread is not one atomic step. Kotlin’s Mutex vs a single-thread executor, and the production failures that come with each.

12 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/one-turnstile-or-one-lane-mutex-vs-a-single-thread-executor-on-android?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/the-64-slot-waiting-room-why-flatmaplatest-still-hands-your-ui-yesterday-s-data/6af4a70ce4032a425a9a98a2)

### [The 64-Slot Waiting Room: Why flatMapLatest Still Hands Your UI Yesterday's Data](https://android-expert.hashnode.dev/the-64-slot-waiting-room-why-flatmaplatest-still-hands-your-ui-yesterday-s-data?utm_source=hashnode&utm_medium=feed)

A slow map after flatMapLatest can replay up to 64 stale values. Here’s how conflate, mapLatest, and identity checks fix it in Kotlin Flow.

10 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/the-64-slot-waiting-room-why-flatmaplatest-still-hands-your-ui-yesterday-s-data?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/a-chat-finder-that-never-loses-its-place-telegram-style-search-with-flow-scan/6af4a6fb490cd6db65443d23)

### [A Chat Finder That Never Loses Its Place: Telegram-Style Search with Flow.scan](https://android-expert.hashnode.dev/a-chat-finder-that-never-loses-its-place-telegram-style-search-with-flow-scan?utm_source=hashnode&utm_medium=feed)

One MutableSharedFlow and one scan reducer give you match counts, up/down navigation, highlighting, and scroll-to-match without locks.

14 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/a-chat-finder-that-never-loses-its-place-telegram-style-search-with-flow-scan?utm_source=hashnode&utm_medium=feed)

[Android Expert](https://hashnode.com/@android-expert) · [Nov 11](https://hashnode.com/posts/one-snackbar-three-streams-choosing-between-stateflow-sharedflow-and-channel/6af4a6ede4032a425a9a4c29)

### [One Snackbar, Three Streams: Choosing Between StateFlow, SharedFlow, and Channel](https://android-expert.hashnode.dev/one-snackbar-three-streams-choosing-between-stateflow-sharedflow-and-channel?utm_source=hashnode&utm_medium=feed)

Why your snackbar fires twice after rotation, and how to choose the right stream for UI state, one-shot events, event buses, and queues.

16 min read · [android-expert.hashnode.dev](https://android-expert.hashnode.dev/one-snackbar-three-streams-choosing-between-stateflow-sharedflow-and-channel?utm_source=hashnode&utm_medium=feed)
