Class: AsyncRack::Runtime

Inherits:
AsyncCallback
  • Object
show all
Defined in:
lib/async_rack/runtime.rb

Instance Method Summary collapse

Instance Method Details

#async_callback(result) ⇒ Object



5
6
7
8
9
10
# File 'lib/async_rack/runtime.rb', line 5

def async_callback(result)
  status, headers, body =result
  request_time = Time.now - @start_time
  headers[@header_name] = "%0.6f" % request_time if !headers.has_key?(@header_name)
  super [status, headers, body]
end

#call(env) ⇒ Object



12
13
14
15
# File 'lib/async_rack/runtime.rb', line 12

def call(env)
  @start_time = Time.now
  super
end