Class: HTTTee::Server::AsyncFixer

Inherits:
Object
  • Object
show all
Defined in:
lib/htttee/server/middleware/async_fixer.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ AsyncFixer

Returns a new instance of AsyncFixer.



4
5
6
# File 'lib/htttee/server/middleware/async_fixer.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/htttee/server/middleware/async_fixer.rb', line 8

def call(env)
  tuple = @app.call(env)

  if tuple.first == -1
    Thin::Connection::AsyncResponse
  else
    tuple
  end
end