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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rygel Louv
November 14, 2020
Programming
0
59
Kotlin Coroutines
Introduction to Kotlin Coroutines. We went through the basic concepts of Coroutines.
Rygel Louv
November 14, 2020
Tweet
Share
More Decks by Rygel Louv
See All by Rygel Louv
Leading Beyond Titles: Mobile Engineering Leadership from Both Sides of the Table
rygelouv
0
17
Model Context Protocol: Connecting AI Models to the Real World
rygelouv
0
35
Exploring Mobile Release Management: Strategies and Best Practices
rygelouv
0
210
State Machines and How they Shape Mobile Architectures
rygelouv
0
210
Feature Flags for Mobile Development
rygelouv
0
220
Build and Publish an Open Source Android Library for Fun and Non profit
rygelouv
1
140
Kotlin "by" Delegation
rygelouv
0
100
Introduction to Type-Safe Builders: create a DSL in Kotlin
rygelouv
0
240
Annotation processing: generate code, eliminate boilerplate
rygelouv
0
140
Other Decks in Programming
See All in Programming
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
dchart: charts from deck markup
ajstarks
3
990
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
200
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
180
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
2026年 エンジニアリング自己学習法
yumechi
0
140
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Designing for Timeless Needs
cassininazir
0
130
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Evolving SEO for Evolving Search Engines
ryanjones
0
130
Measuring & Analyzing Core Web Vitals
bluesmoon
9
750
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
The agentic SEO stack - context over prompts
schlessera
0
640
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