Class: Upfluence::Utils::IntervalExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/upfluence/utils/interval_executor.rb

Constant Summary collapse

DEFAULT_INTERVAL =
60*60*6

Class Method Summary collapse

Class Method Details

.start(interval = DEFAULT_INTERVAL) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/upfluence/utils/interval_executor.rb', line 7

def start(interval = DEFAULT_INTERVAL)
  Thread.new do
    loop do
      yield

      sleep(interval)
    end
  end
end