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
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
340
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
1
450
Leading Effective Engineering Teams in the AI Era
addyosmani
6
440
私はどうやって技術力を上げたのか
yusukebe
43
19k
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
Cursorハンズオン実践!
eltociear
2
1.1k
CSC509 Lecture 05
javiergs
PRO
0
300
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
0
110
株式会社 Sun terras カンパニーデック
sunterras
0
320
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
32k
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
1k
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.2k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Statistics for Hackers
jakevdp
799
220k
Gamification - CAS2011
davidbonilla
81
5.5k
We Have a Design System, Now What?
morganepeng
53
7.8k
A Tale of Four Properties
chriscoyier
161
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
189
55k
Why Our Code Smells
bkeepers
PRO
340
57k
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