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
69
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
11
Concurrency in Scala: from locks to STM
bednam
0
100
Other Decks in Programming
See All in Programming
英語
s_shimotori
1
220
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.9k
CSC307 Lecture 13
javiergs
PRO
0
150
「2024年版 Kotlin サーバーサイドプログラミング実践開発」の補講 〜O/Rマッパー編〜
n_takehata
2
260
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
20240706_CDKConf
takuyay0ne
0
1.2k
SRE チーム立ち上げ前に考えたこと・取り組んだこと / Considerations and Preparations Before Establishing an SRE Team
mackey0225
3
320
Harnessing Large Language Models for Training-free Video Anomaly Detection
tereka114
1
1.3k
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
Terraformテスト入門
msato
0
540
Introduction to GitOps
hwchiu
0
110
Featured
See All Featured
The Invisible Customer
myddelton
117
13k
Git: the NoSQL Database
bkeepers
PRO
423
64k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
52k
Web Components: a chance to create the future
zenorocha
307
41k
Side Projects
sachag
451
42k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
78
15k
KATA
mclloyd
20
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
28
2.2k
Why Our Code Smells
bkeepers
PRO
332
56k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
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