Class: Rack::GarbageCollector
- Inherits:
-
Object
- Object
- Rack::GarbageCollector
- Defined in:
- lib/rack/contrib/garbagecollector.rb
Overview
Forces garbage collection after each request.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ GarbageCollector
constructor
A new instance of GarbageCollector.
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 |