Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:lsmcd:commands:cas [2016/04/06 21:35]
Rob Holda created
litespeed_wiki:lsmcd:commands:cas [2016/04/07 18:54] (current)
Rob Holda
Line 1: Line 1:
 ===== cas ===== ===== cas =====
-Check-and-Set an item; store data only if no one else has updated the item since its last fetch, determined with the cas token from the **gets** command. LSMCD assigns a unique 64-bit ​CAS token to all items stored in it. +Check-and-Set an item; store data only if no one else has updated the item since its last fetch, determined with the cas token from the [[litespeed_wiki:​lsmcd:​commands:​gets|gets]] ​command. LSMCD assigns a unique 64-bit ​cas token to all items stored in it. 
  
 **syntax:** **syntax:**
Line 8: Line 8:
  
 **parameters:​** **parameters:​**
 +  * **key** - The name of the unique key by which data is accessed.
   * **flags** - A 32-bit unsigned integer that the server stores with the data provided by the user, and returns along with the data when the item is retrieved.   * **flags** - A 32-bit unsigned integer that the server stores with the data provided by the user, and returns along with the data when the item is retrieved.
   * **TTL** - The length of time (in seconds) the key/value pair will be stored in cache. A 0 value means the data will “never expire” and should not be removed from the cache unless required. If the TTL is more than 30 days then LSMCD interprets it as UNIX timestamp for expiration.   * **TTL** - The length of time (in seconds) the key/value pair will be stored in cache. A 0 value means the data will “never expire” and should not be removed from the cache unless required. If the TTL is more than 30 days then LSMCD interprets it as UNIX timestamp for expiration.
Line 25: Line 26:
   * **120** → store data for 2 minutes (120 seconds)   * **120** → store data for 2 minutes (120 seconds)
   * **10** → data is 10 bytes long   * **10** → data is 10 bytes long
-  * **2** → unique token number obtained from **gets** command+  * **2** → unique token number obtained from [[litespeed_wiki:​lsmcd:​commands:​gets|gets]] command 
 + 
 +**possible errors:** 
 +  * **ERROR** - Indicates an error while saving data or the wrong syntax. 
 +  * **EXISTS** - Indicates that someone has modified the CAS data since its last fetch. 
 +  * **NOT_FOUND** - Indicates that the provided key does not exist in the LSMCD server.
  • Admin
  • Last modified: 2016/04/06 21:35
  • by Rob Holda