Class: LruRedux::ThreadSafeCache

Inherits:
Cache
  • Object
show all
Includes:
MonitorMixin
Defined in:
lib/lru_redux/thread_safe_cache.rb

Instance Method Summary collapse

Constructor Details

#initialize(max_size) ⇒ ThreadSafeCache

Returns a new instance of ThreadSafeCache.



6
7
8
# File 'lib/lru_redux/thread_safe_cache.rb', line 6

def initialize(max_size)
  super(max_size)
end

Instance Method Details

#[](key) ⇒ Object



28
29
30
31
32
# File 'lib/lru_redux/thread_safe_cache.rb', line 28

def [](key)
  synchronize do
    super(key)
  end
end

#[]=(key, value) ⇒ Object



34
35
36
37
38
# File 'lib/lru_redux/thread_safe_cache.rb', line 34

def []=(key, value)
  synchronize do
    super(key, value)
  end
end

#clearObject



58
59
60
61
62
# File 'lib/lru_redux/thread_safe_cache.rb', line 58

def clear
  synchronize do
    super
  end
end

#countObject



64
65
66
67
68
# File 'lib/lru_redux/thread_safe_cache.rb', line 64

def count
  synchronize do
    super
  end
end

#delete(key) ⇒ Object



52
53
54
55
56
# File 'lib/lru_redux/thread_safe_cache.rb', line 52

def delete(key)
  synchronize do
    super(key)
  end
end

#eachObject



40
41
42
43
44
# File 'lib/lru_redux/thread_safe_cache.rb', line 40

def each
  synchronize do
    super
  end
end

#fetch(key) ⇒ Object



22
23
24
25
26
# File 'lib/lru_redux/thread_safe_cache.rb', line 22

def fetch(key)
  synchronize do
    super(key)
  end
end

#getset(key) ⇒ Object



16
17
18
19
20
# File 'lib/lru_redux/thread_safe_cache.rb', line 16

def getset(key)
  synchronize do
    super(key)
  end
end

#max_size=(size) ⇒ Object



10
11
12
13
14
# File 'lib/lru_redux/thread_safe_cache.rb', line 10

def max_size=(size)
  synchronize do
    super(size)
  end
end

#to_aObject



46
47
48
49
50
# File 'lib/lru_redux/thread_safe_cache.rb', line 46

def to_a
  synchronize do
    super
  end
end

#valid?Boolean

Returns:

  • (Boolean)


70
71
72
73
74
# File 'lib/lru_redux/thread_safe_cache.rb', line 70

def valid?
  synchronize do
    super
  end
end