Class: Rollout::Zookeeper::Storage
- Inherits:
-
Object
- Object
- Rollout::Zookeeper::Storage
- Defined in:
- lib/rollout/zookeeper/storage.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(zk, path, options = {}) ⇒ Storage
constructor
A new instance of Storage.
- #set(key, value) ⇒ Object
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, = {}) @cache = ::Rollout::Zookeeper::DistributedHashtable.new(zk, path, ) 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 |