class DCell::Registry::HazelcastAdapter
Public Class Methods
new(options = {})
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 6 def initialize(options = {}) # Convert all options to symbols :/ options = options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h } @env = options[:env] || 'production' @hazelcast = Hazelcast.new(:env => @env) @node_registry = NodeRegistry.new(@hazelcast) @global_registry = GlobalRegistry.new(@hazelcast) end
Public Instance Methods
clear_globals()
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 21 def clear_globals @global_registry.clear end
clear_nodes()
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 17 def clear_nodes @node_registry.clear end
get_global(key)
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 83 def get_global(key) @global_registry.get(key) end
get_node(node_id)
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 47 def get_node(node_id) @node_registry.get(node_id) end
global_keys()
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 91 def global_keys @global_registry.global_keys end
nodes()
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 55 def nodes @node_registry.nodes end
set_global(key, value)
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 87 def set_global(key, value) @global_registry.set(key, value) end
set_node(node_id, addr)
click to toggle source
# File lib/dcell/registries/hazelcast_adapter.rb, line 51 def set_node(node_id, addr) @node_registry.set(node_id, addr) end