Class: Unicorn::Timeout

Inherits:
Object
  • Object
show all
Defined in:
lib/unicorn/timeout.rb,
lib/unicorn/timeout/version.rb

Constant Summary collapse

VERSION =
"1.0.0"

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Timeout

Returns a new instance of Timeout.



12
13
14
# File 'lib/unicorn/timeout.rb', line 12

def initialize(app)
  @app = app
end

Class Attribute Details

.handlerObject

Returns the value of attribute handler.



8
9
10
# File 'lib/unicorn/timeout.rb', line 8

def handler
  @handler
end

.signalObject

Returns the value of attribute signal.



9
10
11
# File 'lib/unicorn/timeout.rb', line 9

def signal
  @signal
end

.timeoutObject

Returns the value of attribute timeout.



7
8
9
# File 'lib/unicorn/timeout.rb', line 7

def timeout
  @timeout
end

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/unicorn/timeout.rb', line 16

def call(env)
  t = setup_mon_thread

  begin
    @app.call(env)
  ensure
    kill_mon_thread(t)
  end
end