Class: LaunchDarkly::ThreadSafeMemoryStore

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/store.rb

Instance Method Summary collapse

Constructor Details

#initialize ⇒ ThreadSafeMemoryStore

Returns a new instance of ThreadSafeMemoryStore.



5
6
7
# File 'lib/ldclient-rb/store.rb', line 5

def initialize
  @cache = ThreadSafe::Cache.new
end

Instance Method Details

#read(key) ⇒ Object



9
10
11
# File 'lib/ldclient-rb/store.rb', line 9

def read(key)
  @cache[key]
end

#write(key, value) ⇒ Object



13
14
15
# File 'lib/ldclient-rb/store.rb', line 13

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