Class: RequestReplay::Middleware
- Inherits:
-
Object
- Object
- RequestReplay::Middleware
- Defined in:
- lib/request-replay/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, host, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, host, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
5 6 7 |
# File 'lib/request-replay/middleware.rb', line 5 def initialize app, host, ={} @app, @host, @options = app, host, end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/request-replay/middleware.rb', line 9 def call env # We don't want to read the socket in a thread, so create it in main # thread, and send the data in a thread as we don't care the responses Thread.new(RequestReplay.new(env, @host, @options), &:start) @app.call(env) end |