Class: IOPromise::Rack::ContextMiddleware
- Inherits:
-
Object
- Object
- IOPromise::Rack::ContextMiddleware
- Defined in:
- lib/iopromise/rack/context_middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ContextMiddleware
constructor
A new instance of ContextMiddleware.
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 |