Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kotlin Coroutines
Search
Rygel Louv
November 14, 2020
Programming
85
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
Harness Engineering and Agent Design
rygelouv
0
14
Leading Beyond Titles: Mobile Engineering Leadership from Both Sides of the Table
rygelouv
0
74
Model Context Protocol: Connecting AI Models to the Real World
rygelouv
0
85
Exploring Mobile Release Management: Strategies and Best Practices
rygelouv
0
300
State Machines and How they Shape Mobile Architectures
rygelouv
0
290
Feature Flags for Mobile Development
rygelouv
0
270
Build and Publish an Open Source Android Library for Fun and Non profit
rygelouv
1
180
Kotlin "by" Delegation
rygelouv
0
140
Introduction to Type-Safe Builders: create a DSL in Kotlin
rygelouv
0
280
Other Decks in Programming
See All in Programming
Railsバージョンを4倍にした話
optim
0
920
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
170
AI-Powered Domain-Driven Design
ziobrando
0
390
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
570
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
150
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.1k
AmebaブログはKMPから卒業します
kmars0605
0
320
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
610
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
400
LLM 101
dalinaum
0
460
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
4
1.5k
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
2
12k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
580
So, you think you're a good person
axbom
PRO
2
2.2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
How to make the Groovebox
asonas
2
2.5k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
60k
Skip the Path - Find Your Career Trail
mkilby
1
280
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
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