Class: Corkscrews::Rack
- Inherits:
-
Object
- Object
- Corkscrews::Rack
- Defined in:
- lib/corkscrews/rack.rb
Defined Under Namespace
Classes: ResponseBody
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, progress_name: :rack_request) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app, progress_name: :rack_request) ⇒ Rack
Returns a new instance of Rack.
7 8 9 10 |
# File 'lib/corkscrews/rack.rb', line 7 def initialize(app, progress_name: :rack_request) @app = app @progress_name = progress_name end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/corkscrews/rack.rb', line 12 def call(env) Corkscrews.latency_begin(@progress_name) status, headers, body = @app.call(env) Corkscrews.progress(@progress_name) [status, headers, ResponseBody.new(body, @progress_name)] rescue Exception Corkscrews.latency_end(@progress_name) raise end |