Class: Mosaic::Poller

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/mosaic/poller.rb,
lib/mosaic/poller/version.rb

Constant Summary collapse

VERSION =
"0.5.0"

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Poller

Returns a new instance of Poller.



8
9
10
11
12
# File 'lib/mosaic/poller.rb', line 8

def initialize(name, options = {})
  @name = name
  @stopped = false
  @poll_interval = options[:poll_interval] || 15
end

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/mosaic/poller.rb', line 14

def run
  Daemons.run_proc(@name, :dir => File.expand_path('tmp/pids'), :dir_mode => :normal, :backtrace => true) do
    reload
    process
  end
end