# Coroutines racing! Why, and how.

DevFeed: [Coroutines racing! Why, and how.](<https://devfeed.tech/articles/coroutines-racing-why-and-how-26302.md>)

Original publisher: [Read original article](<https://blog.louiscad.com/coroutines-racing-why-and-how>)

Author: Louis CAD

Published: 2021-11-08T07:52:48Z

Content type: tutorial

Language: en

Sources: [Louis CAD doing software](<https://devfeed.tech/sources/louis-cad-doing-software.md>)

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

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

## AI overview

A Kotlin tutorial about racing multiple related coroutines so that the first operation to complete cancels the remaining contenders. It introduces use cases and discusses a straightforward approach and its shortcomings.

## Source excerpt

Over the years, I found myself needing the following: Run multiple related coroutines (i.e. asynchronous operations), and when one completes, cancel/stop the other ones. As usual, and especially since we're in Kotlin, I have been looking for the easi...