Class: RailsDevelopmentBoost::Async::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_development_boost/async.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



6
7
8
# File 'lib/rails_development_boost/async.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rails_development_boost/async.rb', line 10

def call(env)
  if DependenciesPatch.applied? && DependenciesPatch.async?
    Async.synchronize { @app.call(env) }
  else
    @app.call(env)
  end
end