Class: ActionDispatch::Executor
- Defined in:
- actionpack/lib/action_dispatch/middleware/executor.rb
Direct Known Subclasses
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, executor) ⇒ Executor
constructor
A new instance of Executor.
Constructor Details
#initialize(app, executor) ⇒ Executor
Returns a new instance of Executor.
7 8 9 |
# File 'actionpack/lib/action_dispatch/middleware/executor.rb', line 7 def initialize(app, executor) @app, @executor = app, executor end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'actionpack/lib/action_dispatch/middleware/executor.rb', line 11 def call(env) state = @executor.run!(reset: true) begin response = @app.call(env) returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! } rescue => error @executor.error_reporter.report(error, handled: false, source: "application.action_dispatch") raise ensure state.complete! unless returned end end |