Sha256: 19d296077e61de910ce166dd7a33959714fb41ebb8bcaced11dc770a46195c74

Contents?: true

Size: 411 Bytes

Versions: 9

Compression:

Stored size: 411 Bytes

Contents

module Chillout
  module Middleware
    class CreationsMonitor
      def initialize(app, client)
        @app = app
        @client = client
      end

      def call(env)
        response = @app.call(env)
      ensure
        if Thread.current[:creations]
          @client.enqueue(Thread.current[:creations])
          Thread.current[:creations] = nil
        end
        response
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
chillout-0.5.3 lib/chillout/middleware/creations_monitor.rb
chillout-0.5.2 lib/chillout/middleware/creations_monitor.rb
chillout-0.5.1 lib/chillout/middleware/creations_monitor.rb
chillout-0.5.0 lib/chillout/middleware/creations_monitor.rb
chillout-0.4.1 lib/chillout/middleware/creations_monitor.rb
chillout-0.4.0 lib/chillout/middleware/creations_monitor.rb
chillout-0.3.0 lib/chillout/middleware/creations_monitor.rb
chillout-0.2.3 lib/chillout/middleware/creations_monitor.rb
chillout-0.2.2 lib/chillout/middleware/creations_monitor.rb