Class: Circuitry::Middleware::Rack
- Inherits:
-
Object
- Object
- Circuitry::Middleware::Rack
- Defined in:
- lib/circuitry/middleware/rack.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app, options = {}) ⇒ Rack
Returns a new instance of Rack.
7 8 9 10 11 |
# File 'lib/circuitry/middleware/rack.rb', line 7 def initialize(app, = {}) @app = app Circuitry.publisher_config.async_strategy = .fetch(:publish_async_strategy, :batch) Circuitry.subscriber_config.async_strategy = .fetch(:subscribe_async_strategy, :thread) end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/circuitry/middleware/rack.rb', line 13 def call(env) status, headers, actual_body = @app.call(env) body = ::Rack::BodyProxy.new(actual_body) do Circuitry.flush end [status, headers, body] end |