Sha256: 8887818c5ee5bf5657452b433f1957a52f0db055bcc531d3b6fe16ece19d8bb1

Contents?: true

Size: 449 Bytes

Versions: 5

Compression:

Stored size: 449 Bytes

Contents

# frozen_string_literal: true

module CableReady
  module Updatable
    class MemoryCacheDebounceAdapter
      include Singleton

      delegate_missing_to :@store

      def initialize
        super
        @store = ActiveSupport::Cache::MemoryStore.new(expires_in: 5.minutes, size: 8.megabytes)
      end

      def []=(key, value)
        @store.write(key, value)
      end

      def [](key)
        @store.read(key)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cable_ready-5.0.6 app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb
cable_ready-5.0.3 app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb
cable_ready-5.0.2 app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb
cable_ready-5.0.1 app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb
cable_ready-5.0.0 app/models/concerns/cable_ready/updatable/memory_cache_debounce_adapter.rb