Class: IOPromise::Rack::ContextMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/iopromise/rack/context_middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ContextMiddleware

Returns a new instance of ContextMiddleware.



8
9
10
# File 'lib/iopromise/rack/context_middleware.rb', line 8

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
# File 'lib/iopromise/rack/context_middleware.rb', line 12

def call(env)
  IOPromise::CancelContext.with_new_context do
    @app.call(env)
  end
end