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
70
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
120
Other Decks in Programming
See All in Programming
カスタムしながら理解するGraphQL Connection
yanagii
0
680
RailsのPull requestsのレビューの時に私が考えていること
yahonda
4
1.5k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
4
150
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
120
go.mod、DockerfileやCI設定に分散しがちなGoのバージョンをまとめて管理する / Go Connect #3
arthur1
10
2.3k
WEBエンジニア向けAI活用入門
sutetotanuki
0
290
2万ページのSSG運用における工夫と注意点 / Vue Fes Japan 2024
chinen
3
1.3k
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
2
1.6k
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
2.9k
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
530
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
220
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
350
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.8k
The Cost Of JavaScript in 2023
addyosmani
45
6.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
41
9.2k
Facilitating Awesome Meetings
lara
49
6k
How to train your dragon (web standard)
notwaldorf
88
5.6k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Side Projects
sachag
452
42k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.1k
Testing 201, or: Great Expectations
jmmastey
38
7k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
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