Class: XRBP::SHAMap::TaggedCache
- Inherits:
-
Object
- Object
- XRBP::SHAMap::TaggedCache
- Defined in:
- lib/xrbp/nodestore/shamap/tagged_cache.rb
Overview
Internal node caching mechanism.
TODO timeout mechanism, metrics
Instance Method Summary collapse
- #canonicalize(key, node) ⇒ Object
- #fetch(key) ⇒ Object
-
#initialize ⇒ TaggedCache
constructor
A new instance of TaggedCache.
Constructor Details
#initialize ⇒ TaggedCache
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 |