Class: Rollout::Zookeeper::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/rollout/zookeeper/storage.rb

Instance Method Summary collapse

Constructor Details

#initialize(zk, path, options = {}) ⇒ Storage

Returns a new instance of Storage.



5
6
7
# File 'lib/rollout/zookeeper/storage.rb', line 5

def initialize(zk, path, options = {})
  @cache = ::Rollout::Zookeeper::DistributedHashtable.new(zk, path, options)
end

Instance Method Details

#get(key) ⇒ Object



9
10
11
# File 'lib/rollout/zookeeper/storage.rb', line 9

def get(key)
  @cache[key]
end

#set(key, value) ⇒ Object



13
14
15
# File 'lib/rollout/zookeeper/storage.rb', line 13

def set(key, value)
  @cache[key] = value.to_s
end