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
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
160
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
140
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
140
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.4k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
180
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.4k
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
It's Worth the Effort
3n
188
29k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
340
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
The Pragmatic Product Professional
lauravandoore
37
7.1k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Visualization
eitanlees
150
17k
Scaling GitHub
holman
464
140k
Typedesign – Prime Four
hannesfritz
42
2.9k
[SF Ruby Conf 2025] Rails X
palkan
1
750
Making Projects Easy
brettharned
120
6.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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