<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kotlin Coroutine on Guowei Lv</title>
    <link>https://www.lvguowei.me/categories/kotlin-coroutine/</link>
    <description>Recent content in Kotlin Coroutine on Guowei Lv</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 04 May 2026 11:53:34 +0300</lastBuildDate><atom:link href="https://www.lvguowei.me/categories/kotlin-coroutine/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Flow exception handling (Part 1)</title>
      <link>https://www.lvguowei.me/post/kotlin-flow-exception/</link>
      <pubDate>Mon, 04 May 2026 11:53:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-flow-exception/</guid>
      <description>You may have heard that &amp;ldquo;No try/catch inside Flow&amp;rdquo; or &amp;ldquo;Only use catch() operator&amp;rdquo;. But why? Let&amp;rsquo;s explore from the beginning.
Here is a very simple setup:
fun main() = runBlocking { val worker = Worker() val scope = CoroutineScope(EmptyCoroutineContext) val flow = flow { emit(1) emit(2) emit(3) } scope.launch { try { flow.collect { println(worker.doWork(it)) } } catch (e: Exception) { println(&amp;#34;Error in collect: ${e.message}&amp;#34;) } } delay(10000) } class Worker { fun doWork(n: Int): String = if (Random.</description>
    </item>
    
    <item>
      <title>What is a Coroutine?</title>
      <link>https://www.lvguowei.me/post/kotlin-coroutine-1/</link>
      <pubDate>Tue, 17 Jun 2025 11:53:34 +0300</pubDate>
      
      <guid>https://www.lvguowei.me/post/kotlin-coroutine-1/</guid>
      <description>The first question we should ask when learning Kotlin Coroutine is: what is a Coroutine after all?
Let&amp;rsquo;s go back to the Thread world and ask the same question, what is a Thread? Here is code that will create a simple Thread and start it:
val thread = thread { } So the answer seems obvious, a Thread is just the Thread object returned.
Easy.
Can we say the same in the Coroutine world?</description>
    </item>
    
  </channel>
</rss>
