Method: Joumae::Transaction#start_thread

Defined in:
lib/joumae/transaction.rb

#start_threadObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/joumae/transaction.rb', line 16

def start_thread
  fail "Thread already started" if @thread

  @thread = Thread.start {
    loop do
      sleep @renew_interval
      @thread.exit if finished?
      @client.renew(@resource_name)
    end
  }
end