Class: PumaPlus::WorkerThread::Hijack
- Inherits:
-
Object
- Object
- PumaPlus::WorkerThread::Hijack
- Defined in:
- lib/puma_plus/worker_thread.rb
Overview
Instance Method Summary collapse
- #call ⇒ Object
- #hijacked? ⇒ Boolean
-
#initialize(conn, env) ⇒ Hijack
constructor
A new instance of Hijack.
- #to_proc ⇒ Object
Constructor Details
#initialize(conn, env) ⇒ Hijack
Returns a new instance of Hijack.
300 301 302 303 304 |
# File 'lib/puma_plus/worker_thread.rb', line 300 def initialize(conn, env) @conn = conn @env = env @hijacked = false end |
Instance Method Details
#call ⇒ Object
312 313 314 315 316 317 318 |
# File 'lib/puma_plus/worker_thread.rb', line 312 def call return @conn if @hijacked @conn.write Wire.frame(Wire::HIJACK) @hijacked = true @env["rack.hijack_io"] = @conn end |
#hijacked? ⇒ Boolean
306 |
# File 'lib/puma_plus/worker_thread.rb', line 306 def hijacked? = @hijacked |
#to_proc ⇒ Object
308 309 310 |
# File 'lib/puma_plus/worker_thread.rb', line 308 def to_proc method(:call).to_proc end |