Class: Cylons::RegistryAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/cylons/registry_adapter.rb

Constant Summary collapse

VALID_REGISTRY_ADAPTERS =
[:zk, :redis].freeze

Class Method Summary collapse

Class Method Details

.redis(options = {}) ⇒ Object



26
27
28
29
# File 'lib/cylons/registry_adapter.rb', line 26

def self.redis(options = {})
  redis_registry_hash = redis_defaults.dup
  redis_registry_hash
end

.redis_defaultsObject



22
23
24
# File 'lib/cylons/registry_adapter.rb', line 22

def self.redis_defaults
  {:adapter => 'redis', :port => 6379, :address => "127.0.0.1"}
end

.zk(options = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/cylons/registry_adapter.rb', line 15

def self.zk(options = {})
  zk_registry_hash = zk_defaults.dup
  zk_registry_hash[:server] = ::Cylons.configuration.registry_address if ::Cylons.configuration.registry_address
  zk_registry_hash[:registry_port] = ::Cylons.configuration.registry_port if ::Cylons.configuration.registry_port
  zk_registry_hash
end

.zk_defaultsObject

TODO: Add redis adapter support… maybe..



11
12
13
# File 'lib/cylons/registry_adapter.rb', line 11

def self.zk_defaults
  {:adapter => 'zk', :port => '2181', :server => ::Cylons::Interface.primary}
end