#Coroutines
Wow Rust coroutines are cool!
My little `f(x) { prefetch(x); yield; compute(x); }` benchmark is ~8ns per call with explicit prefetching in a loop, and ~9ns per call when using coroutine abstractions :)

(I first spent a full day struggling with async, which I only got down to 14ns with much pain.)
November 7, 2025 at 9:58 AM
Interesting paper showing that stackful coroutines (used for example in Go and Erlang) are not intrinsically slower than stackless coroutines (used for example in Rust, Python and JavaScript):
photonlibos.github.io/blog/stackfu...
Stackful Coroutine Made Fast | PhotonLibOS
Download pdf
photonlibos.github.io
October 28, 2025 at 8:13 PM
We have just released a new ACCU Video!

Taming the Many-Headed Async Monster: From Callbacks to Coroutines - Sam Cooper - ACCU York

#coding #programming #softwareengineering
Taming the Many-Headed Async Monster: From Callbacks to Coroutines - Sam Cooper - ACCU York
youtu.be
October 28, 2025 at 3:01 PM
A conversation around Kotlin coroutines 💜

@sebi.io, @zsmb.co, and @marcinmoskala.bsky.social spent two glorious hours exploring coroutines in depth.

🎙️ If you love Kotlin, you won't want to miss this episode: www.youtube.com/watch?v=1zY4...
Discussing Kotlin Coroutines with Marcin Moskała | Talking Kotlin 141
YouTube video by Kotlin by JetBrains
www.youtube.com
October 21, 2025 at 4:44 AM
The Spring team has just released Spring Framework 7.0.0-RC1 with new features like automatic context propagation for Kotlin coroutines, a Jackson 3.0.0 baseline and much more.

The final version is planned next month!

spring.io/blog/2025/10...
Spring Framework 7.0.0-RC1 available now
Level up your Java code and explore what Spring can do for you.
spring.io
October 16, 2025 at 2:21 PM
Coroutines are really super cool, I love them, but they can also make everything a bizarre mess to debug, a Spaghetti Monster, A delayed spaghetti flying dragon of asynchronous despair...

I just lost two full days untangling this mess. My mess.

Still, I love them ;-;
a man is sitting at a desk in a dark room with bunk beds
ALT: a man is sitting at a desk in a dark room with bunk beds
media.tenor.com
October 9, 2025 at 3:48 AM
typescript generators are just funny looking lua coroutines
October 8, 2025 at 3:27 AM
Ever feel stuck when it comes to asynchronous programming in C++? Coroutines simplify your code and make it more readable—but only if you know how to use them. Get yourself the Howto.

https://fertig.to/slcoro

#cpp20 #programming #coroutines #cpp
Join my C++ coroutines self-study course
fertig.to
October 6, 2025 at 2:27 PM
Dart `coroutines` v0.1.1 released! ✨💙
Minor improvements and added `isCoroutineRunning` ~
pub.dev/packages/cor...

#FlutterDev #DartDev #gamedev
coroutines | Dart package
Unity-style coroutines for Dart, allowing resumable function execution.
pub.dev
October 5, 2025 at 9:54 PM
Thanks to @luanpotter.bsky.social for feedback on `isCoroutineRunning`

Next release will include async coroutines ☝️😌✨
October 5, 2025 at 9:58 PM
🎯Day 4 of #100daysofcoding
✅Revising Coroutines
✅ Solved 1 leetcode medium question
✅Building Apple Liquid Glass theme in my app (
@quotesdotapp
)

Repo👉 : github.com/shalenMathew...

#buildinpublic #kotlin #java #androiddev #developers #JetpackCompose #AndroidDev #letsconnect
September 27, 2025 at 4:34 PM
`coroutines` v0.1.0 is now live on pub.dev ! 🥳✨💕🌙
Resumable functions for everyone - tell a friend! #FlutterDev
pub.dev/packages/cor...

(this is actually the first Dart package I published myself - long overdue 🥲)
coroutines | Dart package
Unity-style coroutines for Dart, allowing resumable function execution.
pub.dev
September 21, 2025 at 10:50 PM
I implemented my own coroutines in raw C99. I use them here for the stone animations. #C #C99 #C11 #gamedev #handmade #gameengine #fromscratch
September 21, 2025 at 7:43 PM
I’m back with experimenting in Swift. Trying to figure out how to use Tasks as an alternative to C coroutines. The whole @MainActor malarkey is not simple #gamedev
September 21, 2025 at 10:03 PM
Tip to tell suspending functions and coroutines apart in Kotlin:

💡👉 Think of a suspending function as the script for a play, and a coroutine as the performance. 🎭

Every chapter in my book 📚 Kotlin Coroutine Confidence ends with a "Key Concepts" recap to help you remember what you've learned 👍
September 16, 2025 at 10:40 AM
Unity-style coroutines in Dart, anyone? ✨
(package coming soon~)
#FlutterDev
September 14, 2025 at 12:02 AM
Love, bugs, and coroutines—come vibe with us @NXVRStudio for your daily dose of game dev madness and sarcastic life lessons. ❤️🎮

#GameDevAndChill #GameDev #GameDesign #Unity3D #IndieDev
November 27, 2024 at 12:46 AM
Kotlin Coroutines in Firebase: Polymorphism of Button States Learn how to implement button state ...

https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/

#Android #Development

Event Attributes
Kotlin Coroutines in Firebase: Polymorphism of Button States
<p><strong>B/polymorphism of Button States using Kotlin Coroutines in Firebase</strong></p> <p><strong>Introduction</strong></p> <p>B/polymorphism of Button States using Kotlin Coroutines in Firebase is a technique used to manage button states in Android applications using Kotlin Coroutines. This technique allows for more efficient and scalable code by utilizing asynchronous programming and the Firebase Firestore database. In this tutorial, we will cover the core concepts, implementation guide, code examples, best practices, testing, and debugging of this technique.</p> <h3 id="what-readers-will-learn">What Readers Will Learn</h3> <ul> <li>How to implement B/polymorphism of Button States using Kotlin Coroutines in Firebase</li> <li>How to use Firebase Firestore to store and retrieve button states</li> <li>How to optimize and secure the implementation</li> <li>How to test and debug the code</li> </ul> <h3 id="prerequisites">Prerequisites</h3> <ul> <li>Basic understanding of Kotlin and Android development</li> <li>Firebase Firestore and Firebase Kotlin SDK installed</li> <li>Android Studio or a similar IDE</li> </ul> <h3 id="technologiestools-needed">Technologies/Tools Needed</h3> <ul> <li>Android Studio or a similar IDE</li> <li>Firebase Firestore</li> <li>Firebase Kotlin SDK</li> <li>Kotlin Coroutines</li> <li>Kotlin Extensions</li> </ul> <h3 id="relevant-links-to-toolspackages">Relevant Links to Tools/Packages</h3> <ul> <li>Firebase Firestore: <a href="https://firebase.google.com/docs/firestore" rel="noopener" target="_blank">https://firebase.google.com/docs/firestore</a></li> <li>Firebase Kotlin SDK: <a href="https://firebase.google.com/docs/kotlin" rel="noopener" target="_blank">https://firebase.google.com/docs/kotlin</a></li> <li>Kotlin Coroutines: <a href="https://kotlincoroutines.org/" rel="noopener" target="_blank">https://kotlincoroutines.org/</a></li> <li>Kotlin Extensions: <a href="https://kotlinlang.org/docs/extensions.html" rel="noopener" target="_blank">https://kotlinlang.org/docs/extensions.html</a></li> </ul> <p><strong>Technical Background</strong></p> <h3 id="core-concepts-and-terminology">Core Concepts and Terminology</h3> <ul> <li>B/polymorphism: a technique used to manage button states by storing and retrieving the state from a database</li> <li>Kotlin Coroutines: a library for writing asynchronous code in Kotlin</li> <li>Firebase Firestore: a NoSQL document database for storing and retrieving data</li> <li>Firebase Kotlin SDK: a library for interacting with Firebase Firestore from Kotlin</li> </ul> <h3 id="how-it-works-under-the-hood">How it Works Under the Hood</h3> <ol> <li>The application stores the button state in a Firebase Firestore document</li> <li>The application uses Kotlin Coroutines to fetch and update the button state from the Firestore document</li> <li>The application uses B/polymorphism to determine the correct button state based on the current state of the button</li> </ol> <h3 id="best-practices-and-common-pitfalls">Best Practices and Common Pitfalls</h3> <ul> <li>Use Firebase Firestore to store and retrieve button states</li> <li>Use Kotlin Coroutines to handle asynchronous operations</li> <li>Avoid overloading the Firestore database with unnecessary data</li> <li>Handle errors and exceptions properly</li> </ul> <p><strong>Implementation Guide</strong></p> <h3 id="step-1-create-a-firebase-firestore-database">Step 1: Create a Firebase Firestore Database</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Create a Firebase Firestore database val db = FirebaseFirestore.getInstance() </code></pre> <h3 id="step-2-define-the-button-state-data-model">Step 2: Define the Button State Data Model</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Define the button state data model data class ButtonState(val state: Boolean) // Define a function to create a new button state document fun createButtonStateDocument(): Task&lt;Void&gt; { return db.collection("buttonStates").add(ButtonState(false)) } </code></pre> <h3 id="step-3-create-a-function-to-fetch-the-button-state">Step 3: Create a Function to Fetch the Button State</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Create a function to fetch the button state fun fetchButtonState(): Task&lt;ButtonState&gt; { return db.collection("buttonStates").document().get().await() } </code></pre> <h3 id="step-4-create-a-function-to-update-the-button-state">Step 4: Create a Function to Update the Button State</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Create a function to update the button state fun updateButtonState(state: Boolean): Task&lt;Void&gt; { return db.collection("buttonStates").document().set(ButtonState(state)) } </code></pre> <h3 id="step-5-use-kotlin-coroutines-to-handle-asynchronous-operations">Step 5: Use Kotlin Coroutines to Handle Asynchronous Operations</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Use Kotlin Coroutines to handle asynchronous operations fun buttonClick(): Task&lt;Void&gt; { val currentState = fetchButtonState().await() updateButtonState(!currentState.state) return Unit } </code></pre> <p><strong>Code Examples</strong></p> <h3 id="example-1-basic-button-state-management">Example 1: Basic Button State Management</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Create a Firebase Firestore database val db = FirebaseFirestore.getInstance() // Define the button state data model data class ButtonState(val state: Boolean) // Create a function to create a new button state document fun createButtonStateDocument(): Task&lt;Void&gt; { return db.collection("buttonStates").add(ButtonState(false)) } // Create a function to fetch the button state fun fetchButtonState(): Task&lt;ButtonState&gt; { return db.collection("buttonStates").document().get().await() } // Create a function to update the button state fun updateButtonState(state: Boolean): Task&lt;Void&gt; { return db.collection("buttonStates").document().set(ButtonState(state)) } // Use Kotlin Coroutines to handle asynchronous operations fun buttonClick(): Task&lt;Void&gt; { val currentState = fetchButtonState().await() updateButtonState(!currentState.state) return Unit } </code></pre> <h3 id="example-2-edge-cases-and-error-handling">Example 2: Edge Cases and Error Handling</h3> <pre class="wp-block-code"><code class="language-plaintext" lang="plaintext"> // Create a Firebase Firestore database val db = FirebaseFirestore.getInstance() // Define the button state data model data class ButtonState(val state: Boolean) // Create a function to create a new button state document fun createButtonStateDocument(): Task&lt;Void&gt; { return db.collection("buttonStates").add(ButtonState(false)) } // Create a function to fetch the button state fun fetchButtonState(): Task&lt;ButtonState&gt; { return db.collection("buttonStates").document().get().await()?: ButtonState(false) } // Create a function to update the button state fun updateButtonState(state: Boolean): Task&lt;Void&gt; { return db.collection("buttonStates").document().set(ButtonState(state)).addOnFailureListener { Log.e("ButtonState", "Error updating button state: ${it.message}") } } // Use Kotlin Coroutines to handle asynchronous operations fun buttonClick(): Task&lt;Void&gt; { try { val currentState = fetchButtonState().await() updateButtonState(!currentState.state) } catch (e: Exception) { Log.e("ButtonState", "Error updating button state: $e") } return Unit } </code></pre> <p><strong>Best Practices and Optimization</strong></p> <h3 id="performance-considerations">Performance Considerations</h3> <ul> <li>Use Firebase Firestore to store and retrieve button states</li> <li>Use Kotlin Coroutines to handle asynchronous operations</li> <li>Avoid overloading the Firestore database with unnecessary data</li> <li>Optimize the database schema to reduce the number of queries</li> </ul> <h3 id="security-considerations">Security Considerations</h3> <ul> <li>Use Firebase Firestore to store and retrieve button states</li> <li>Use Kotlin Coroutines to handle asynchronous operations</li> <li>Handle errors and exceptions properly</li> <li>Use authentication and authorization to secure the database</li> </ul> <h3 id="code-organization-tips">Code Organization Tips</h3> <ul> <li>Create a separate module for the button state management</li> <li>Use a consistent naming convention for the data model and functions</li> <li>Organize the code into separate functions and classes</li> </ul> <h3 id="common-mistakes-to-avoid">Common Mistakes to Avoid</h3> <ul> <li>Overloading the Firestore database with unnecessary data</li> <li>Not handling errors and exceptions properly</li> <li>Not using authentication and authorization to secure the database</li> </ul> <p><strong>Testing and Debugging</strong></p> <h3 id="testing">Testing</h3> <ul> <li>Use JUnit to write unit tests for the button state management</li> <li>Use Espresso to write UI tests for the button state management</li> <li>Test the code thoroughly to ensure it works as expected</li> </ul> <h3 id="debugging">Debugging</h3> <ul> <li>Use the Android Studio debugger to step through the code</li> <li>Use the Firebase Firestore debugger to inspect the database</li> <li>Use the Android Studio logcat to inspect the logs</li> </ul> <h3 id="common-issues-and-solutions">Common Issues and Solutions</h3> <ul> <li><strong>Error updating button state:</strong> Make sure to handle errors and exceptions properly.</li> <li><strong>Button state not updating:</strong> Make sure to update the button state correctly.</li> <li><strong>Database not syncing:</strong> Make sure to use the Firebase Firestore debugger to inspect the database.</li> </ul> <p><strong>Conclusion</strong></p> <p>B/polymorphism of Button States using Kotlin Coroutines in Firebase is a powerful technique for managing button states in Android applications. By using Firebase Firestore to store and retrieve button states, Kotlin Coroutines to handle asynchronous operations, and a consistent coding style, developers can create efficient and scalable code. This tutorial has covered the core concepts, implementation guide, code examples, best practices, testing, and debugging of this technique. By following the guidelines and best practices outlined in this tutorial, developers can create high-quality applications that are scalable, efficient, and secure.</p> <div class="sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon sd-sharing"><h3 class="sd-title">Sharing is Caring:</h3><div class="sd-content"><ul><li class="share-facebook"><a class="share-facebook sd-button share-icon no-text" data-shared="sharing-facebook-23799" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=facebook" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on Facebook"><span></span><span class="sharing-screen-reader-text">Click to share on Facebook (Opens in new window)</span></a></li><li class="share-twitter"><a class="share-twitter sd-button share-icon no-text" data-shared="sharing-twitter-23799" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=twitter" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on Twitter"><span></span><span class="sharing-screen-reader-text">Click to share on Twitter (Opens in new window)</span></a></li><li class="share-jetpack-whatsapp"><a class="share-jetpack-whatsapp sd-button share-icon no-text" data-shared="" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=jetpack-whatsapp" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on WhatsApp"><span></span><span class="sharing-screen-reader-text">Click to share on WhatsApp (Opens in new window)</span></a></li><li class="share-linkedin"><a class="share-linkedin sd-button share-icon no-text" data-shared="sharing-linkedin-23799" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=linkedin" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on LinkedIn"><span></span><span class="sharing-screen-reader-text">Click to share on LinkedIn (Opens in new window)</span></a></li><li class="share-reddit"><a class="share-reddit sd-button share-icon no-text" data-shared="" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=reddit" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on Reddit"><span></span><span class="sharing-screen-reader-text">Click to share on Reddit (Opens in new window)</span></a></li><li class="share-telegram"><a class="share-telegram sd-button share-icon no-text" data-shared="" href="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=telegram" rel="nofollow noopener noreferrer" target="_blank" title="Click to share on Telegram"><span></span><span class="sharing-screen-reader-text">Click to share on Telegram (Opens in new window)</span></a></li><li class="share-email"><a class="share-email sd-button share-icon no-text" data-email-share-error-text="If you're having problems sharing via email, you might not have email set up for your browser. You may need to create a new email yourself." data-email-share-error-title="Do you have email set up?" data-email-share-nonce="c4b21da7a7" data-email-share-track-url="https://codezup.com/kotlin-coroutines-firebase-button-states-polymorphism/?share=email" data-shared="" href="https://codezup.com/cdn-cgi/l/email-protection#3f004c4a5d555a5c4b021a0a7d6c575e4d5a5b1a0d0f6f504c4b1a0a7b1a0d0f74504b5356511a0d0f7c504d504a4b56515a4c1a0d0f56511a0d0f79564d5a5d5e4c5a1a0c7e1a0d0f6f50534652504d4f57564c521a0d0f50591a0d0f7d4a4b4b50511a0d0f6c4b5e4b5a4c195d505b4602574b4b4f4c1a0c7e1a0d791a0d795c505b5a454a4f115c50521a0d7954504b535651125c504d504a4b56515a4c1259564d5a5d5e4c5a125d4a4b4b5051124c4b5e4b5a4c124f50534652504d4f57564c521a0d79194c575e4d5a025a525e5653" rel="nofollow noopener noreferrer" target="_blank" title="Click to email a link to a friend"><span></span><span class="sharing-screen-reader-text">Click to email a link to a friend (Opens in new window)</span></a></li><li class="share-end"></li></ul></div></div></div>
codezup.com
February 10, 2025 at 10:01 AM
Love, bugs, and coroutines—come vibe with us @NXVRStudio for your daily dose of game dev madness and sarcastic life lessons. ❤�#GameDevAndChillv#GameDev #GameDesigna#Unity3D #IndieDev#IndieDev
November 19, 2024 at 12:46 AM
Thanks for this!

If you haven't seen it yet, the paper "Kotlin Coroutines: Design and Implementation" is a nice overview of the design space: www.researchgate.net/profile/Mikh...

Kotlin also made a few interesting choices which I haven't seen in other languages.
(PDF) Kotlin coroutines: design and implementation
PDF | On Oct 20, 2021, Roman Elizarov and others published Kotlin coroutines: design and implementation | Find, read and cite all the research you need on ResearchGate
www.researchgate.net
November 18, 2024 at 12:58 PM
Hana Dusikova might be working on constexpr coroutines, unsure
January 2, 2025 at 11:14 PM
Interviewer: "Now we go to the topic of functional programming"
starts asking questions about coroutines…
January 31, 2025 at 9:26 AM