> But what I'm asking is whether there is some reason that gets() and 
> cas() aren't written so that they succeed if you call them on a key 
> that doesn't exist.  If the key didn't exist when you called gets(), 
> and it still doesn't exist when you call cas(), then it "hasn't 
> changed", so why not just let cas() succeed in that case?  It would 
> save the trouble of having to do two branches of code.

This can be handled in the client, the server doesn't need to do anything.

I've modified the client we use (Enyim) so that if the gets fails, it
returns a CAS token of "0" and then my version of cas() knows if it gets a
CAS token of 0 to do an add() instead.

Dean.


Reply via email to