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.



4
5
6
# File 'lib/rack/contrib/garbagecollector.rb', line 4

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
# File 'lib/rack/contrib/garbagecollector.rb', line 8

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