Class: LookupBy::Caching::SafeLRU

Inherits:
LRU
  • Object
show all
Includes:
Mutex_m
Defined in:
lib/lookup_by/caching/safe_lru.rb

Instance Method Summary collapse

Methods inherited from LRU

#max_size=

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

#clearObject



22
23
24
# File 'lib/lookup_by/caching/safe_lru.rb', line 22

def clear
  synchronize { super }
end

#countObject



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

#eachObject



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

Returns:

  • (Boolean)


42
43
44
# File 'lib/lookup_by/caching/safe_lru.rb', line 42

def key?(key)
  synchronize { super }
end

#sizeObject



46
47
48
# File 'lib/lookup_by/caching/safe_lru.rb', line 46

def size
  synchronize { super }
end

#to_aObject



50
51
52
# File 'lib/lookup_by/caching/safe_lru.rb', line 50

def to_a
  synchronize { super }
end

#to_hObject



54
55
56
# File 'lib/lookup_by/caching/safe_lru.rb', line 54

def to_h
  synchronize { super }
end

#valuesObject



58
59
60
# File 'lib/lookup_by/caching/safe_lru.rb', line 58

def values
  synchronize { super }
end