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
Rygel Louv
November 14, 2020
Programming
65
0
Share
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
35
Model Context Protocol: Connecting AI Models to the Real World
rygelouv
0
41
Exploring Mobile Release Management: Strategies and Best Practices
rygelouv
0
220
State Machines and How they Shape Mobile Architectures
rygelouv
0
220
Feature Flags for Mobile Development
rygelouv
0
230
Build and Publish an Open Source Android Library for Fun and Non profit
rygelouv
1
150
Kotlin "by" Delegation
rygelouv
0
110
Introduction to Type-Safe Builders: create a DSL in Kotlin
rygelouv
0
250
Annotation processing: generate code, eliminate boilerplate
rygelouv
0
150
Other Decks in Programming
See All in Programming
「速くなった気がする」をデータで疑う
senleaf24
0
150
CDK Deployのための ”反響定位”
watany
0
120
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
2
260
Don't Prompt Harder, Structure Better
kitasuke
0
380
SkillがSkillを生む:QA観点出しを自動化した
sontixyou
6
3.1k
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
320
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
2
150
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
860
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
6.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
For a Future-Friendly Web
brad_frost
183
10k
Balancing Empowerment & Direction
lara
5
1k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
110
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
210
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
350
[SF Ruby Conf 2025] Rails X
palkan
2
930
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
210
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
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