Class: MysqlReplicationHelper::Daemon

Inherits:
Object
  • Object
show all
Defined in:
lib/mysql_replication_helper/daemon.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Daemon

Returns a new instance of Daemon.



3
4
5
6
7
8
# File 'lib/mysql_replication_helper/daemon.rb', line 3

def initialize(options)
  @options = options
  
  @options[:master] = @master = Agent::Master.new(options)
  @options[:slave] = @slave = Agent::Slave.new(options)
end

Instance Method Details

#run!Object



10
11
12
13
14
15
16
# File 'lib/mysql_replication_helper/daemon.rb', line 10

def run!
  while (true)
    @master.poll!
    @slave.poll!
    sleep(10)
  end
end