Class: Synapse::ZookeeperDnsWatcher::Zookeeper

Inherits:
Synapse::ZookeeperWatcher show all
Defined in:
lib/synapse/service_watcher/zookeeper_dns.rb

Constant Summary

Constants inherited from Synapse::ZookeeperWatcher

Synapse::ZookeeperWatcher::NUMBERS_RE

Constants inherited from BaseWatcher

BaseWatcher::LEADER_WARN_INTERVAL

Instance Attribute Summary

Attributes inherited from BaseWatcher

#haproxy, #name

Instance Method Summary collapse

Methods inherited from Synapse::ZookeeperWatcher

#ping?, #start, #stop

Methods inherited from BaseWatcher

#backends, #ping?, #start, #stop

Methods included from Logging

configure_logger_for, #log, logger_for

Constructor Details

#initialize(opts = {}, synapse, message_queue) ⇒ Zookeeper


110
111
112
113
114
# File 'lib/synapse/service_watcher/zookeeper_dns.rb', line 110

def initialize(opts={}, synapse, message_queue)
  super(opts, synapse)

  @message_queue = message_queue
end

Instance Method Details

#reconfigure!Object

Overrides reconfigure! to cause the new list of servers to be messaged to the DNS watcher rather than invoking a synapse reconfigure directly


118
119
120
121
# File 'lib/synapse/service_watcher/zookeeper_dns.rb', line 118

def reconfigure!
  # push the new backends onto the queue
  @message_queue.push(Messages::NewServers.new(@backends))
end