Class: Chillout::Middleware::CreationsMonitor
- Inherits:
-
Object
- Object
- Chillout::Middleware::CreationsMonitor
- Defined in:
- lib/chillout/middleware/creations_monitor.rb
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app, client) ⇒ CreationsMonitor
constructor
A new instance of CreationsMonitor.
Constructor Details
#initialize(app, client) ⇒ CreationsMonitor
Returns a new instance of CreationsMonitor.
4 5 6 7 |
# File 'lib/chillout/middleware/creations_monitor.rb', line 4 def initialize(app, client) @app = app @client = client end |
Instance Method Details
#_call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/chillout/middleware/creations_monitor.rb', line 13 def _call(env) status, headers, body = @app.call(env) return status, headers, body ensure if creations = Chillout.creations @client.logger.debug "Non-empty creations container found" @client.enqueue(creations) Chillout.creations = nil end body.close if body && body.respond_to?(:close) && $! end |
#call(env) ⇒ Object
9 10 11 |
# File 'lib/chillout/middleware/creations_monitor.rb', line 9 def call(env) dup._call(env) end |