Class: Synapse::ZookeeperWatcher

Inherits:
BaseWatcher show all
Defined in:
lib/synapse/service_watcher/zookeeper.rb

Instance Attribute Summary

Attributes inherited from BaseWatcher

#backends, #listen, #local_port, #name, #server_options

Instance Method Summary collapse

Methods inherited from BaseWatcher

#initialize

Constructor Details

This class inherits a constructor from Synapse::BaseWatcher

Instance Method Details

#startObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/synapse/service_watcher/zookeeper.rb', line 9

def start
  zk_hosts = @discovery['hosts'].shuffle.join(',')

  log.info "synapse: starting ZK watcher #{@name} @ hosts: #{zk_hosts}, path: #{@discovery['path']}"
  @zk = ZK.new(zk_hosts)

  @deserializer = Thrift::Deserializer.new

  watch
  discover
end