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
66
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
6
Concurrency in Scala: from locks to STM
bednam
0
76
Other Decks in Programming
See All in Programming
slow types ってなんだろう?
karad
0
120
Webアプリをできるだけコードを手書きしないで作ってみる
tomokusaba
2
190
Netty Chicago Java User Group 2024-04-17
sullis
0
210
新宿ダンジョンを可視化してみた
satoshi7190
3
400
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
180
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
990
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.3k
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
1.1k
Snowflakeで眠ったデータを起こそう!
estie
0
150
Git Lint
bkuhlmann
4
760
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
200
Balkan Ruby 2024 — How and why to run SQLite on Rails in production
fractaledmind
0
100
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
79
43k
Scaling GitHub
holman
457
140k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
25
2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Atom: Resistance is Futile
akmur
260
25k
What the flash - Photography Introduction
edds
64
11k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Designing with Data
zakiwarfel
96
4.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
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