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
82
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
24
Concurrency in Scala: from locks to STM
bednam
0
170
Other Decks in Programming
See All in Programming
AIで効率化できた業務・日常
ochtum
0
140
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
200
Performance Engineering for Everyone
elenatanasoiu
0
170
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
260
CSC307 Lecture 17
javiergs
PRO
0
320
Agentic UI
manfredsteyer
PRO
0
170
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
240
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.1k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
5.4k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.3k
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2.1k
Producing Creativity
orderedlist
PRO
348
40k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
440
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
390
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
200
30 Presentation Tips
portentint
PRO
1
330
Optimizing for Happiness
mojombo
378
71k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
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