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
84
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
2
Leading Beyond Titles: Mobile Engineering Leadership from Both Sides of the Table
rygelouv
0
69
Model Context Protocol: Connecting AI Models to the Real World
rygelouv
0
79
Exploring Mobile Release Management: Strategies and Best Practices
rygelouv
0
290
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
170
Kotlin "by" Delegation
rygelouv
0
130
Introduction to Type-Safe Builders: create a DSL in Kotlin
rygelouv
0
280
Other Decks in Programming
See All in Programming
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
Kotlinの15年とServer-Side Kotlin
n_takehata
1
150
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
The Rails Doctrine Decade
koic
2
590
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Claude Code のすすめ
schroneko
67
230k
A Soul's Torment
seathinner
8
3.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Rails Girls Zürich Keynote
gr2m
96
14k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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