Sha256: 1283ca6e9ea19f4d8ceb59d668d23bca70a78ee6e852752b5baa4335acb40a12
Contents?: true
Size: 930 Bytes
Versions: 10
Compression:
Stored size: 930 Bytes
Contents
require 'thread_safe' module LaunchDarkly # A thread-safe in-memory store suitable for use # with the Faraday caching HTTP client. Uses the # Threadsafe gem as the underlying cache. # # @see https://github.com/plataformatec/faraday-http-cache # @see https://github.com/ruby-concurrency/thread_safe # class ThreadSafeMemoryStore # # Default constructor # # @return [ThreadSafeMemoryStore] a new store def initialize @cache = ThreadSafe::Cache.new end # # Read a value from the cache # @param key [Object] the cache key # # @return [Object] the cache value def read(key) @cache[key] end # # Store a value in the cache # @param key [Object] the cache key # @param value [Object] the value to associate with the key # # @return [Object] the value def write(key, value) @cache[key] = value end end end
Version data entries
10 entries across 10 versions & 1 rubygems