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
Froze middleware talk
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Atul Bhosale
July 29, 2017
Technology
0
43
Froze middleware talk
I had given this talk at Deccan Ruby Conf 2017, Pune
Atul Bhosale
July 29, 2017
Tweet
Share
More Decks by Atul Bhosale
See All by Atul Bhosale
Lets enhance ActionCable
atul9
0
57
Mystery of Realtime
atul9
0
45
Other Decks in Technology
See All in Technology
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
220
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
150
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
170
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
150
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
2.1k
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
530
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
130
20260208_第66回 コンピュータビジョン勉強会
keiichiito1978
0
130
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
Greatest Disaster Hits in Web Performance
guaca
0
210
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
0
350
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Designing Experiences People Love
moore
144
24k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
80
Skip the Path - Find Your Career Trail
mkilby
0
54
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
The Invisible Side of Design
smashingmag
302
51k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Transcript
ATUL BHOSALE CODEMANCERS @atul1b
None
Rack middleware
None
1 5 4 3 2 Web Requests
None
None
WHY?
# Non Thread safe code class Counter def initialize @counter
= 0 end def call(_env) counter = @counter sleep 1 counter += 1 @counter = counter [200, { 'Content-Type' => 'text/html' }, ["#{@counter}"]] end end
WHAT? • Don’t mutate state • Freeze middleware instances •
Use data-structures from concurrent-ruby
None
# Thread safe code class Counter def initialize @atomic =
Concurrent::AtomicReference.new(0) end def call(_env) @atomic.update { |v| v + 1 } [200, { 'Content-Type' => 'text/html' }, ["{@atomic}"]] end end
None
None
None
use (Class.new do def call(env) @a = 1 if env['PATH_INFO']
== '/a' @app.call(env) end freeze_app end)
There is no way to unfreeze a frozen object
Thank you
None