Class: Vx::Worker::Timeout
- Inherits:
-
Struct
- Object
- Struct
- Vx::Worker::Timeout
- Defined in:
- lib/vx/worker/middlewares/timeout.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app
6 7 8 |
# File 'lib/vx/worker/middlewares/timeout.rb', line 6 def app @app end |
Instance Method Details
#_timeout ⇒ Object
16 17 18 |
# File 'lib/vx/worker/middlewares/timeout.rb', line 16 def _timeout 30 * 60 end |
#call(env) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/vx/worker/middlewares/timeout.rb', line 8 def call(env) rs = nil ::Timeout.timeout(_timeout) do rs = app.call env end rs end |