lib/memcached/memcached.rb
def cas(key, ttl=@default_ttl, marshal=true, flags=FLAGS)
    raise ClientError, "CAS not enabled for this Memcached instance" unless options[:support_cas]

    value, flags, ret = Lib.memcached_get_rvalue(@struct, key)
    check_return_code(ret, key)
    cas = @struct.result.cas

    value = Marshal.load(value) if marshal
    value = yield value
    value = Marshal.dump(value) if marshal

    check_return_code(Lib.memcached_cas(@struct, key, value, ttl, flags, cas), key)
  end
# Reads a key's value from the server and yields it to a block. Replaces the key's value with the result of the block as long as the key hasn't been updated in the meantime, otherwise raises <b>Memcached::NotStored</b>. Accepts a String <tt>key</tt> and a block.
#
# Also accepts an optional <tt>ttl</tt> value.
#
# CAS stands for "compare and swap", and avoids the need for manual key mutexing. CAS support must be enabled in Memcached.new or a <b>Memcached::ClientError</b> will be raised. Note that CAS may be buggy in memcached itself.
#
Reads a key's value from the server and yields it to a block. Replaces the key's value with the result of the block as long as the key hasn't been updated in the meantime, otherwise raises Memcached::NotStored. Accepts a String key and a block.
Also accepts an optional ttl value.

CAS stands for "compare and swap", and avoids the need for manual key mutexing. CAS support must be enabled in Memcached.new or a Memcached::ClientError will be raised. Note that CAS may be buggy in memcached itself.
Reads a key ' s value from the server and yields it to a block . Replaces the key ' s value with the result of the block as long as the key hasn ' t been updated in the meantime otherwise raises Memcached :: NotStored . Accepts a String key and a block . Also accepts an optional ttl value . CAS stands for " compare and swap " and avoids the need for manual key mutexing . CAS support must be enabled in Memcached . new or a Memcached :: ClientError will be raised . Note that CAS may be buggy in memcached itself .
def cas(key, ttl=@default_ttl, marshal=true, flags=FLAGS)
    raise ClientError, "CAS not enabled for this Memcached instance" unless options[:support_cas]
    value, flags, ret = Lib.memcached_get_rvalue(@struct, key)
    check_return_code(ret, key)
    cas = @struct.result.cas
    value = Marshal.load(value) if marshal
    value = yield value
    value = Marshal.dump(value) if marshal
    check_return_code(Lib.memcached_cas(@struct, key, value, ttl, flags, cas), key)
  end
def cas ( key , ttl = @default_ttl , marshal = true , flags = FLAGS ) raise ClientError , "CAS not enabled for this Memcached instance" unless options [ :support_cas ] value , flags , ret = Lib . memcached_get_rvalue ( @struct , key ) check_return_code ( ret , key ) cas = @struct . result . cas value = Marshal . load ( value ) if marshal value = yield value value = Marshal . dump ( value ) if marshal check_return_code ( Lib . memcached_cas ( @struct , key , value , ttl , flags , cas ) , key ) end
Reads a key's value from the server and yields it to a block.
Reads a key ' s value from the server and yields it to a block .
key
ttl
marshal
flags