lib/memcached-server/memcache.rb
# Check and set operation that stores a MemcachedServer::Item only if no one else has updated since it was last fetched
# Depends on #store_item method
# 
# @param key [String] The key of the item to store
# @param flags [Integer] Is an arbitrary unsigned integer (written out in decimal)
# @param exptime [Integer] The exptime of the Item to store
# @param bytes [Integer] The byte size of <data_block>
# @param data_block [String] Is a chunk of arbitrary 8-bit data of length <bytes>
# @param cas_id [Integer] Is a unique integer value
# @return [String] The reply that describes the result of the operation
Check and set operation that stores a MemcachedServer::Item only if no one else has updated since it was last fetched
Depends on #store_item method
Check and set operation that stores a MemcachedServer :: Item only if no one else has updated since it was last fetched Depends on #store_item method
def cas(key, flags, exptime, bytes, cas_id, data_block)
            purge_keys()
            return Reply::NOT_FOUND unless @storage.key?(key)
            item = @storage[key]
            item.lock.synchronize do
                return Reply::EXISTS if cas_id != item.cas_id
            end
            store_item(key, flags, exptime, bytes, data_block)
            return Reply::STORED
        end
def cas ( key , flags , exptime , bytes , cas_id , data_block ) purge_keys ( ) return Reply :: NOT_FOUND unless @storage . key? ( key ) item = @storage [ key ] item . lock . synchronize do return Reply :: EXISTS if cas_id != item . cas_id end store_item ( key , flags , exptime , bytes , data_block ) return Reply :: STORED end
Check and set operation that stores a MemcachedServer::Item only if no one else has updated since it was last fetched
Depends on #store_item method
Check and set operation that stores a MemcachedServer :: Item only if no one else has updated since it was last fetched Depends on #store_item method
The reply that describes the result of the operation
The reply that describes the result of the operation
String
key
The key of the item to store
The key of the item to store
flags
None
exptime
The exptime of the Item to store
The exptime of the Item to store
bytes
The byte size of 
The byte size of
cas_id
None
data_block
None