Module: Qyu::Workers::Concerns::Timeout

Included in:
Base
Defined in:
lib/qyu/workers/concerns/timeout.rb

Overview

Qyu::Workers::Concerns::Timeout

Adds timeout to running tasks in a worker

Qyu::Worker.new do

timeout 0 # disabled (default)
# or
timeout 3600

end

Instance Method Summary collapse

Instance Method Details

#timeout(seconds) ⇒ Object

Configures timeout

timeout 0 # default
timeout 3600

26
27
28
# File 'lib/qyu/workers/concerns/timeout.rb', line 26

def timeout(seconds)
  @timeout = seconds.to_i
end