class ResetCurrentThread::Middleware

Public Class Methods

new(app) click to toggle source
# File lib/reset_current_thread/middleware.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source

Sets all items in the current thread and fiber local to nil, in the end.

# File lib/reset_current_thread/middleware.rb, line 10
def call(env)
  @app.call(env)
ensure
  ResetCurrentThread.all!
end