CAS operation

Dustin Sallings dustin at spy.net
Sat Sep 8 08:12:48 UTC 2007


On Sep 8, 2007, at 1:07, Chris Goffinet wrote:

> So with every object having a 64 bit unique value, if I call gets,  
> I retrieve a value for the object (unique value), then send  
> memcache this old value (64 bit unique), new value (new update of  
> object) and if the unique is still the same for object, it will  
> push the change?

	Right, that's the idea.  Otherwise, it'll tell you that the key has  
expired (or otherwise gone missing) or that it's changed since you  
last looked at it.

	gets gives you both the value and the value identifier at the same  
time (otherwise, there wouldn't be much of a point).

	The regular get operation(s) could potentially return the same  
thing, but it would require protocol extensions that may confuse  
clients in the ascii protocol, and would definitely do so in the  
binary protocol.

-- 
Dustin Sallings


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070908/8aa5a5d0/attachment-0001.html


More information about the memcached mailing list