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
84
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scala: Context & Observability
Slides for The Art of Scala presentation in Warsaw on 25th May 2023
Michał Bednarz
May 25, 2023
More Decks by Michał Bednarz
See All by Michał Bednarz
Scala: The Ideal Language for Game Wallets
bednam
0
27
Concurrency in Scala: from locks to STM
bednam
0
170
Other Decks in Programming
See All in Programming
typoなんかねぇよ
raspython3
0
490
Cloudflare is Agents
chimame
0
180
Go 1.27 における memory allocation の高速化
andpad
0
300
プロポーザルを書いてもらう
pvcresin
0
580
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
3
1.8k
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
430
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.1k
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
5
520
[PyCon KR 2026] More Variants, More Diversity for AI Accelerators
achimnol
0
110
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
470
Press start. Python's next generation.
willingc
PRO
2
110
メールのエイリアス機能を履き違えない
isshinfunada
0
250
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
420
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Google's AI Overviews - The New Search
badams
0
1.1k
Marketing to machines
jonoalderson
1
5.7k
Agile that works and the tools we love
rasmusluckow
331
22k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
270
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
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