Method: Dalli::Client#replace_cas

Defined in:
lib/dalli/client.rb

#replace_cas(key, value, cas, ttl = nil, req_options = nil) ⇒ Object

Conditionally add a key/value pair, verifying existing CAS, only if the key already exists on the server. Returns the new CAS value if the operation succeeded, or falsy otherwise.



229
230
231
# File 'lib/dalli/client.rb', line 229

def replace_cas(key, value, cas, ttl = nil, req_options = nil)
  perform(:replace, key, value, ttl_or_default(ttl), cas, req_options)
end