Class: XRBP::SHAMap::TaggedCache

Inherits:
Object
  • Object
show all
Defined in:
lib/xrbp/nodestore/shamap/tagged_cache.rb

Overview

Internal node caching mechanism.

TODO timeout mechanism, metrics

Instance Method Summary collapse

Constructor Details

#initializeTaggedCache

Returns a new instance of TaggedCache.



7
8
9
# File 'lib/xrbp/nodestore/shamap/tagged_cache.rb', line 7

def initialize
  @cache = {}
end

Instance Method Details

#canonicalize(key, node) ⇒ Object



15
16
17
# File 'lib/xrbp/nodestore/shamap/tagged_cache.rb', line 15

def canonicalize(key, node)
  @cache[key] = node
end

#fetch(key) ⇒ Object



11
12
13
# File 'lib/xrbp/nodestore/shamap/tagged_cache.rb', line 11

def fetch(key)
  @cache[key]
end