Class: Cylons::RegistryAdapter
- Inherits:
-
Object
- Object
- Cylons::RegistryAdapter
- Defined in:
- lib/cylons/registry_adapter.rb
Constant Summary collapse
- VALID_REGISTRY_ADAPTERS =
[:zk, :redis].freeze
Class Method Summary collapse
- .redis(options = {}) ⇒ Object
- .redis_defaults ⇒ Object
- .zk(options = {}) ⇒ Object
-
.zk_defaults ⇒ Object
TODO: Add redis adapter support…
Class Method Details
.redis(options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/cylons/registry_adapter.rb', line 26 def self.redis( = {}) redis_registry_hash = redis_defaults.dup redis_registry_hash end |
.redis_defaults ⇒ Object
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( = {}) 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 |