Class: Rack::GarbageCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/contrib/garbagecollector.rb

Overview

Forces garbage collection after each request.

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ GarbageCollector

Returns a new instance of GarbageCollector.



6
7
8
# File 'lib/rack/contrib/garbagecollector.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
# File 'lib/rack/contrib/garbagecollector.rb', line 10

def call(env)
  @app.call(env)
ensure
  GC.start
end