Module: Dalli::Threadsafe
- Defined in:
- lib/dalli/options.rb
Overview
Make Dalli threadsafe by using a lock around all public server methods.
Dalli::Server.extend(Dalli::Threadsafe)
Instance Method Summary collapse
Instance Method Details
#alive? ⇒ Boolean
17 18 19 20 21 |
# File 'lib/dalli/options.rb', line 17 def alive? lock.synchronize do super end end |
#close ⇒ Object
23 24 25 26 27 |
# File 'lib/dalli/options.rb', line 23 def close lock.synchronize do super end end |
#lock! ⇒ Object
29 30 31 |
# File 'lib/dalli/options.rb', line 29 def lock! lock.mon_enter end |
#request(op, *args) ⇒ Object
11 12 13 14 15 |
# File 'lib/dalli/options.rb', line 11 def request(op, *args) lock.synchronize do super end end |
#unlock! ⇒ Object
33 34 35 |
# File 'lib/dalli/options.rb', line 33 def unlock! lock.mon_exit end |