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
Scala: Context & Observability
Search
Michał Bednarz
May 25, 2023
Programming
0
71
Scala: Context & Observability
Slides for The Art of Scala presentation in Warsaw on 25th May 2023
Michał Bednarz
May 25, 2023
Tweet
Share
More Decks by Michał Bednarz
See All by Michał Bednarz
Scala: The Ideal Language for Game Wallets
bednam
0
13
Concurrency in Scala: from locks to STM
bednam
0
140
Other Decks in Programming
See All in Programming
Use Perl as Better Shell Script
karupanerura
0
670
ワンバイナリWebサービスのススメ
mackee
10
7.5k
「兵法」から見る質とスピード
ickx
0
230
推論された型の移植性エラーTS2742に挑む
teamlab
PRO
0
160
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
390
Interface vs Types ~型推論が過多推論~
hirokiomote
1
240
AIにコードを生成するコードを作らせて、再現性を担保しよう! / Let AI generate code to ensure reproducibility
yamachu
7
6.1k
tsconfigのオプションで変わる型世界
keisukeikeda
1
130
【TSkaigi 2025】これは型破り?型安全? 真実はいつもひとつ!(じゃないかもしれない)TypeScript クイズ〜〜〜〜!!!!!
kimitashoichi
1
300
Zennの運営完全に理解した #完全に理解したTalk
wadayusuke
1
150
FastMCPでMCPサーバー/クライアントを構築してみる
ttnyt8701
2
110
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.7k
Featured
See All Featured
Six Lessons from altMBA
skipperchong
28
3.8k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Practical Orchestrator
shlominoach
188
11k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
Typedesign – Prime Four
hannesfritz
41
2.6k
Site-Speed That Sticks
csswizardry
8
600
Testing 201, or: Great Expectations
jmmastey
42
7.5k
For a Future-Friendly Web
brad_frost
178
9.8k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Being A Developer After 40
akosma
91
590k
Transcript
Scala: Context & Observability
Context propagation explicit parameter implicit parameter
Thread-safe state on JVM AtomicRef ThreadLocal Every thread has its
own local copy of the state which is not visible to the others Shared state safely updated by many threads using optimistic concurrency (CAS)
Context propagation on JVM ThreadLocal InheritableThreadLocal DynamicVariable
None
None
None
None
None
Scope Lexical Dynamic Depends on location in source code Depends
on method call graph
None
None
None
Functional context propagation ReaderT / Kleisli (cats) IOLocal (cats-effect) Context
functions (scala 3)
Context propagation with cats-mtl Ask Local Stateful read-only environment effect
dynamic scope effect shared mutable state effect
None
None
None
None
None
None
None
Local + log4cats demo
None
Local + log4cats + IOLocal demo
None
None
Scala 3 Context Functions
None
linktr.ee/mbednarz