Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kotlin Coroutines
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Rygel Louv
November 14, 2020
Programming
73
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin Coroutines
Introduction to Kotlin Coroutines. We went through the basic concepts of Coroutines.
Rygel Louv
November 14, 2020
More Decks by Rygel Louv
See All by Rygel Louv
Leading Beyond Titles: Mobile Engineering Leadership from Both Sides of the Table
rygelouv
0
51
Model Context Protocol: Connecting AI Models to the Real World
rygelouv
0
63
Exploring Mobile Release Management: Strategies and Best Practices
rygelouv
0
260
State Machines and How they Shape Mobile Architectures
rygelouv
0
270
Feature Flags for Mobile Development
rygelouv
0
250
Build and Publish an Open Source Android Library for Fun and Non profit
rygelouv
1
160
Kotlin "by" Delegation
rygelouv
0
120
Introduction to Type-Safe Builders: create a DSL in Kotlin
rygelouv
0
270
Annotation processing: generate code, eliminate boilerplate
rygelouv
0
160
Other Decks in Programming
See All in Programming
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
510
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
600
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
220
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
790
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
190
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
220
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
560
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
210
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.4k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
290
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Evolving SEO for Evolving Search Engines
ryanjones
0
230
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
740
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
HDC tutorial
michielstock
2
720
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
850
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
570
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Transcript
Kotlin Coroutines Rygel Louv Dakar Ruby Brigade.
2019 Rygel Louv Software engineer
- Simplifying asynchronous programming - Write async code that looks
like sync code Coroutines: what problem do they solve ? P . 3
Synchronous blocking code P . 3
Synchronous blocking code P . 3
Async code using a callback P . 3
Callback Hell P . 3
Coroutines are the best of both worlds P . 3
Coroutines create a callback under the hood called Continuation P
. 3 Callback
State Machine and Continuation Passing Style P . 3
What is a coroutine ? P . 3 - Not
a thread - Takes a piece of code and run it in a thread - Lightweight thread
- Context switching: withContext - Dispatchers Coroutines concepts P .
3
- Dispatcher.Main: Main thread - Dispatcher.IO: Network and disk -
Dispatcher.Default: CPU (heavy computation) Coroutines dispatchers P . 3
- Canceling coroutine execution - Following a Lifecycle - Informing
components when Exception happens Coroutines concepts: Structured concurrency P . 3 Avoid memory leaks
- Keep track of coroutines - Ability to cancel them
- Is notified of failures Structure concurrency: Scopes P . 3
Coroutine scope: launching coroutines P . 3
P . 3 Coroutine scope: launching coroutines
P . 3 Coroutine scope: launching coroutines Parent Child Scope
will get all exceptions thrown by this function
- Cancels all coroutines - Can not start more coroutines
Scopes: cancelation P . 3
Suspend function in a coroutine P . 3
- When a child fails, the scope get notified -
Then the scope cancel itself and cancel all children Scopes exception handling: Job P . 3
- The failure of one child does not affect other
children - When the scope get notified of a failure, nothing happens Scopes exception handling: SupervisorJob P . 3
Creating coroutines P . 3
Creating coroutines: Launch P . 3 - Creates a new
coroutine - Fire and forget
Creating coroutines: Async P . 3 - Creates a new
coroutine - Returns a value Deferred == Promise/Future
P . 3
Cancellation requires co-operation P . 3
Cancellation require co-operation P . 3 - Check if coroutine
is Active
Next on coroutines P . 3 - Dive deeper in
Continuation Passing Style - More on co-operation - Channels - Flows
P . 27 THANK YOU