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
72
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
iOSアプリ開発で 関数型プログラミングを実現する The Composable Architectureの紹介
yimajo
1
150
20250528 AWS Startupイベント登壇資料:AIコーディングの取り組み
procrustes5
0
150
Go Modules: From Basics to Beyond / Go Modulesの基本とその先へ
kuro_kurorrr
0
100
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
Use Perl as Better Shell Script
karupanerura
0
680
衛星の軌道をWeb地図上に表示する
sankichi92
0
260
インターフェース設計のコツとツボ
togishima
2
680
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
500
つよそうにふるまい、つよい成果を出すのなら、つよいのかもしれない
irof
0
240
生成AIで日々のエラー調査を進めたい
yuyaabo
0
350
RubyKaigiで得られる10の価値 〜Ruby話を聞くことだけが RubyKaigiじゃない〜
tomohiko9090
0
130
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
700
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Typedesign – Prime Four
hannesfritz
42
2.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Invisible Side of Design
smashingmag
299
50k
Facilitating Awesome Meetings
lara
54
6.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
42
2.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
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