Hi,
So I’ve searched and searched and nothing. Can’t believe no one has really needed and used the powerful and comfortable “check and set” method of memcached before me. [size=2]I think that [/size][size=2]cas() is, in short, like ‘SELECT… FOR UPDATE’ in MySQL and allows atomicity of the get and then set methods, effectively ensuring that only one client handles the updating of some cached value (given that they all use the same pattern of get(), storing the token, then cas() passing that token).[/size]
The ‘cas()’ was introduced in the memcached php extension, which is newer than memcache. See this Stackoverflow discussion about the comparison.
Now for our matter: there is no ‘cas()’ method support in CMemCache class. Further more, but this is hardly the focus here, by default CMemCache uses the old (more mature?..) and AFAIK less powerful memcache php extension, instead of memcached extension (which includes this cas() support, and more).
[size=2]Having cas() support in Yii can be very very nice. memcache daemon is a cool, old no SQL caching program that can be used extensively for improving performance. [/size]
Anyone tackled this and can share his/her solution?
Any plans for the future with regard to the mentioned php extensions and their capabilities?
TIA,
Boaz.