Class: LruRedux::ThreadSafeCache
- Includes:
- MonitorMixin
- Defined in:
- lib/lru_redux/thread_safe_cache.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #clear ⇒ Object
- #count ⇒ Object
- #delete(key) ⇒ Object
- #each ⇒ Object
- #fetch(key) ⇒ Object
- #getset(key) ⇒ Object
-
#initialize(max_size) ⇒ ThreadSafeCache
constructor
A new instance of ThreadSafeCache.
- #max_size=(size) ⇒ Object
- #to_a ⇒ Object
- #valid? ⇒ Boolean
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 |
#clear ⇒ Object
58 59 60 61 62 |
# File 'lib/lru_redux/thread_safe_cache.rb', line 58 def clear synchronize do super end end |
#count ⇒ Object
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 |
#each ⇒ Object
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_a ⇒ Object
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
70 71 72 73 74 |
# File 'lib/lru_redux/thread_safe_cache.rb', line 70 def valid? synchronize do super end end |