Class: LookupBy::Caching::SafeLRU
- Includes:
- Mutex_m
- Defined in:
- lib/lookup_by/caching/safe_lru.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #clear ⇒ Object
- #count ⇒ Object
- #delete(key) ⇒ Object
- #each ⇒ Object
- #fetch(key) ⇒ Object
-
#initialize(max_size) ⇒ SafeLRU
constructor
A new instance of SafeLRU.
- #key?(key) ⇒ Boolean
- #size ⇒ Object
- #to_a ⇒ Object
- #to_h ⇒ Object
- #values ⇒ Object
Methods inherited from LRU
Constructor Details
#initialize(max_size) ⇒ SafeLRU
Returns a new instance of SafeLRU.
10 11 12 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 10 def initialize(max_size) super end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 14 def [](key) synchronize { super } end |
#[]=(key, value) ⇒ Object
18 19 20 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 18 def []=(key, value) synchronize { super } end |
#clear ⇒ Object
22 23 24 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 22 def clear synchronize { super } end |
#count ⇒ Object
26 27 28 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 26 def count synchronize { super } end |
#delete(key) ⇒ Object
30 31 32 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 30 def delete(key) synchronize { super } end |
#each ⇒ Object
34 35 36 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 34 def each synchronize { super } end |
#fetch(key) ⇒ Object
38 39 40 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 38 def fetch(key) synchronize { super } end |
#key?(key) ⇒ Boolean
42 43 44 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 42 def key?(key) synchronize { super } end |
#size ⇒ Object
46 47 48 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 46 def size synchronize { super } end |
#to_a ⇒ Object
50 51 52 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 50 def to_a synchronize { super } end |
#to_h ⇒ Object
54 55 56 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 54 def to_h synchronize { super } end |
#values ⇒ Object
58 59 60 |
# File 'lib/lookup_by/caching/safe_lru.rb', line 58 def values synchronize { super } end |