Class: ResetCurrentThread::Middleware
- Inherits:
-
Object
- Object
- ResetCurrentThread::Middleware
- Defined in:
- lib/reset_current_thread/middleware.rb
Instance Method Summary collapse
-
#call(env) ⇒ Object
Sets all items in the current thread and fiber local to nil, in the end.
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 |
# File 'lib/reset_current_thread/middleware.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
Sets all items in the current thread and fiber local to nil, in the end.
10 11 12 13 14 |
# File 'lib/reset_current_thread/middleware.rb', line 10 def call(env) @app.call(env) ensure ResetCurrentThread.all! end |