6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/identity_cache/mem_cache_store_cas.rb', line 6
def cas(name, options = nil)
options = merged_options(options)
key = normalize_key(name, options)
rescue_error_with(false) do
instrument(:cas, key, options) do
@data.with do |connection|
connection.cas(key, options[:expires_in].to_i, options) do |raw_value|
entry = deserialize_entry(raw_value)
value = yield entry.value
entry = ActiveSupport::Cache::Entry.new(value, **options)
options[:raw] ? entry.value.to_s : entry
end
end
end
end
end
|