# runBlocking

Published articles for runBlocking.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Coroutine Essentials

DevFeed: [Coroutine Essentials](<https://devfeed.tech/articles/coroutine-essentials-25051.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-coroutines/>)

Author: author@typealias.com (Dave Leeds)

Published: 2026-08-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [coding](<https://devfeed.tech/topics/coding.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [coding](<https://devfeed.tech/tags/coding.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [deferred](<https://devfeed.tech/tags/deferred.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [job](<https://devfeed.tech/tags/job.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [launch](<https://devfeed.tech/tags/launch.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [software](<https://devfeed.tech/tags/software.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [suspend-function](<https://devfeed.tech/tags/suspend-function.md>), [withcontext](<https://devfeed.tech/tags/withcontext.md>), [yield](<https://devfeed.tech/tags/yield.md>)

### AI overview

This tutorial introduces essential Kotlin coroutine concepts for performing multiple tasks concurrently, such as making network calls while updating a screen. It aims to provide a foundation for day-to-day coding and more advanced coroutine concepts.

### Source excerpt

When you're on hold during a phone call, you might also check your email. While brewing coffee, you might also cook breakfast. And while driving a car, you might listen to a podcast. In the same way, sometimes it's helpful for the software that we write to do more than one thing at a time. For example, it could make two or three network calls at one time--all while updating the screen to show the progress of each call.

## runBlocking in practice: Where it should be used and where not

DevFeed: [runBlocking in practice: Where it should be used and where not](<https://devfeed.tech/articles/runblocking-in-practice-where-it-should-be-used-and-where-not-39373.md>)

Original publisher: [Read original article](<https://kt.academy/article/run_blocking>)

Published: 2025-09-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [runBlocking](<https://devfeed.tech/topics/runblocking.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [dispatcher](<https://devfeed.tech/tags/dispatcher.md>), [guide](<https://devfeed.tech/tags/guide.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [pitfalls](<https://devfeed.tech/tags/pitfalls.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A practical guide to runBlocking in Kotlin Coroutines. It explains how runBlocking converts suspending calls into blocking calls, blocks the calling thread until completion, and creates a new coroutine hierarchy. The article discusses appropriate uses, code smells, and alternatives, including an Android Retrofit interceptor example.

### Source excerpt

A comprehensive guide to using runBlocking in Kotlin Coroutines, including best practices and common pitfalls.

## Slowing down your code with Coroutines

DevFeed: [Slowing down your code with Coroutines](<https://devfeed.tech/articles/slowing-down-your-code-with-coroutines-39375.md>)

Original publisher: [Read original article](<https://kt.academy/article/slowing-down-coroutines>)

Published: 2022-12-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Security](<https://devfeed.tech/topics/security.md>), [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [coroutines](<https://devfeed.tech/tags/coroutines.md>), [exploit](<https://devfeed.tech/tags/exploit.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [security](<https://devfeed.tech/tags/security.md>), [tests](<https://devfeed.tech/tags/tests.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how to use coroutines to slow login responses and reduce timing-attack risk. It also discusses testing the slowdown with runTest, runBlocking, time measurement, tolerance values, and injected TimeSource implementations.

### Source excerpt

How can we use coroutines to slow down our code, and why would we want to do that.

## Kotlin Coroutines use cases for Presentation/API/UI Layer

DevFeed: [Kotlin Coroutines use cases for Presentation/API/UI Layer](<https://devfeed.tech/articles/kotlin-coroutines-use-cases-for-presentation-api-ui-layer-39246.md>)

Original publisher: [Read original article](<https://kt.academy/article/cc-use-cases-presentation-layer>)

Published: 2022-11-30T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [runBlocking](<https://devfeed.tech/topics/runblocking.md>), [ui](<https://devfeed.tech/topics/ui.md>), [Ktor](<https://devfeed.tech/topics/ktor.md>), [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>)

Tags: [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [scope](<https://devfeed.tech/tags/scope.md>), [ui](<https://devfeed.tech/tags/ui.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how Kotlin Coroutines are used in the presentation, API, and UI layers. It covers framework-provided coroutine launches, custom coroutine scopes, scope cancellation, and appropriate uses of runBlocking, including application startup and tests.

### Source excerpt

How do we use Kotlin Coroutines in the Presentation/API/UI Layer Layer, how do we create scope and start coroutines.

## RxJava vs. Kotlin Coroutines, a quick look

DevFeed: [RxJava vs. Kotlin Coroutines, a quick look](<https://devfeed.tech/articles/rxjava-vs-kotlin-coroutines-a-quick-look-24815.md>)

Original publisher: [Read original article](<https://akarnokd.blogspot.com/2017/09/rxjava-vs-kotlin-coroutines-quick-look.html>)

Author: David Karnok (noreply@blogger.com)

Published: 2017-09-05T15:11:00Z

Content type: comparison

Language: en

Sources: [Akarnokd - Advanced RxJava](<https://devfeed.tech/sources/akarnokd-advanced-rxjava.md>)

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Usability](<https://devfeed.tech/topics/usability.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [blocking](<https://devfeed.tech/tags/blocking.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [code](<https://devfeed.tech/tags/code.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [programming](<https://devfeed.tech/tags/programming.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [reactive-programming](<https://devfeed.tech/tags/reactive-programming.md>), [retry](<https://devfeed.tech/tags/retry.md>), [runblocking](<https://devfeed.tech/tags/runblocking.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [suspend](<https://devfeed.tech/tags/suspend.md>), [thread](<https://devfeed.tech/tags/thread.md>), [timeout](<https://devfeed.tech/tags/timeout.md>), [zip](<https://devfeed.tech/tags/zip.md>)

### AI overview

This article compares RxJava and Kotlin Coroutines through an example involving delayed unreliable services, timeouts, cancellation, retries, and combining results. It emphasizes usability over raw performance and describes coroutine code as more sequential and synchronous-looking, while noting that coroutines were experimental at the time.

### Source excerpt

Introduction Does Kotlin Coroutines make RxJava and reactive programming obsolete? The answer depends on who you ask. Enthusiasts and marketing departments would say yes without hesitation. If so, sooner or later developers would have to convert Rx code into coroutines or write something with coroutines from the start. Since Coroutines are currently experimental, there is always the prospect deficiencies, especially regarding the overhead, will be resolved eventually. Therefore, this post will focus more on usability than raw performance. The scenario Let's say we have two functions imitating unreliable service: f1 and f2, both returning a number after some delay. We have to call these services, sum up their returned values and present it to the user. However, if this doesn't happen within 500 milliseconds, we don't expect it to happen reasonably faster, thus we'd like to cancel and retry the two services for a limited amount of time before giving up after some number of retries. The Coroutine Way Programming via coroutines feels like programming with the traditional ExecutorService- and Future-based toolset with the difference that the underlying infrastructure will use suspension, state machine(s) and task rescheduling instead of blocking a thread. First, we need the functions that exhibit the delaying behavior: suspend fun f1(i: Int) { Thread.sleep(if (i != 2) 2000L else 200L) return 1; } suspend fun f2(i: Int) { Thread.sleep(if (i != 2) 2000L else 200L) return 2; } Functions that participate in a coroutine execution should be declared with the suspend keyword and executed within a coroutine context. For demonstration purposes, the logic will sleep for 2 seconds if the parameter supplied to the functions is not 2. This will give a chance to the timeout logic to kick in yet the 3rd attempt to succeed before the timeout. Since going asynchronous usually ends up leaving the main thread, we need a way to block it until the business logic completes before letting the