Sha256: c7c4d5ac5c7a27f8db73dd9252276d2cd0dc44e9bb9c089cfdfcde3470dff29a

Contents?: true

Size: 978 Bytes

Versions: 174

Compression:

Stored size: 978 Bytes

Contents

module ActiveSupport
  module Cache
    # Like MemoryStore, but thread-safe.
    class SynchronizedMemoryStore < MemoryStore
      def initialize
        super
        @guard = Monitor.new
      end

      def fetch(key, options = {})
        @guard.synchronize { super }
      end

      def read(name, options = nil)
        @guard.synchronize { super }
      end

      def write(name, value, options = nil)
        @guard.synchronize { super }
      end

      def delete(name, options = nil)
        @guard.synchronize { super }
      end

      def delete_matched(matcher, options = nil)
        @guard.synchronize { super }
      end

      def exist?(name,options = nil)
        @guard.synchronize { super }
      end

      def increment(key, amount = 1)
        @guard.synchronize { super }
      end

      def decrement(key, amount = 1)
        @guard.synchronize { super }
      end

      def clear
        @guard.synchronize { super }
      end
    end
  end
end

Version data entries

174 entries across 141 versions & 22 rubygems

Version Path
p8-castronaut-0.6.1.1 vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb
relevance-castronaut-0.6.0 vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb
relevance-castronaut-0.6.1 vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb
relevance-castronaut-0.7.4 vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb
relevance-castronaut-0.7.5 vendor/activesupport/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.31 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.31 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.30 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.30 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.29 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.29 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.28 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.28 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.27 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.27 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.26 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.26 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.25 etc/isolate/ruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.25 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb
depengine-0.0.24 etc/isolate/jruby-1.8/gems/activesupport-2.3.8/lib/active_support/cache/synchronized_memory_store.rb