Class: ThreadSafe::SynchronizedCacheBackend

Inherits:
NonConcurrentCacheBackend show all
Includes:
Mutex_m
Defined in:
lib/thread_safe/synchronized_cache_backend.rb

Instance Method Summary collapse

Methods inherited from NonConcurrentCacheBackend

#each_pair, #initialize

Constructor Details

This class inherits a constructor from ThreadSafe::NonConcurrentCacheBackend

Instance Method Details

#[](key) ⇒ Object

WARNING: Mutex_m is a non-reentrant lock, so the synchronized methods are not allowed to call each other.



7
8
9
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 7

def [](key)
  synchronize { super }
end

#[]=(key, value) ⇒ Object



11
12
13
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 11

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

#clearObject



59
60
61
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 59

def clear
  synchronize { super }
end

#compute(key) ⇒ Object



23
24
25
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 23

def compute(key)
  synchronize { super }
end

#compute_if_absent(key) ⇒ Object



15
16
17
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 15

def compute_if_absent(key)
  synchronize { super }
end

#compute_if_present(key) ⇒ Object



19
20
21
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 19

def compute_if_present(key)
  synchronize { super }
end

#delete(key) ⇒ Object



51
52
53
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 51

def delete(key)
  synchronize { super }
end

#delete_pair(key, value) ⇒ Object



55
56
57
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 55

def delete_pair(key, value)
  synchronize { super }
end

#get_and_set(key, value) ⇒ Object



39
40
41
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 39

def get_and_set(key, value)
  synchronize { super }
end

#get_or_default(key, default_value) ⇒ Object



67
68
69
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 67

def get_or_default(key, default_value)
  synchronize { super }
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 43

def key?(key)
  synchronize { super }
end

#merge_pair(key, value) ⇒ Object



27
28
29
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 27

def merge_pair(key, value)
  synchronize { super }
end

#replace_if_exists(key, new_value) ⇒ Object



35
36
37
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 35

def replace_if_exists(key, new_value)
  synchronize { super }
end

#replace_pair(key, old_value, new_value) ⇒ Object



31
32
33
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 31

def replace_pair(key, old_value, new_value)
  synchronize { super }
end

#sizeObject



63
64
65
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 63

def size
  synchronize { super }
end

#value?(value) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/thread_safe/synchronized_cache_backend.rb', line 47

def value?(value)
  synchronize { super }
end