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
44 45 46 47 48 |
# File 'lib/dalli/options.rb', line 44 def alive? lock.synchronize do super end end |
#close ⇒ Object
50 51 52 53 54 |
# File 'lib/dalli/options.rb', line 50 def close lock.synchronize do super end end |
#lock! ⇒ Object
56 57 58 |
# File 'lib/dalli/options.rb', line 56 def lock! lock.mon_enter end |
#request(op, *args) ⇒ Object
38 39 40 41 42 |
# File 'lib/dalli/options.rb', line 38 def request(op, *args) lock.synchronize do super end end |
#unlock! ⇒ Object
60 61 62 |
# File 'lib/dalli/options.rb', line 60 def unlock! lock.mon_exit end |