Class: Vx::Worker::Timeout

Inherits:
Struct
  • Object
show all
Defined in:
lib/vx/worker/middlewares/timeout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



6
7
8
# File 'lib/vx/worker/middlewares/timeout.rb', line 6

def app
  @app
end

Instance Method Details

#_timeoutObject



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