..).
In this scenario, when we finally want to replay the write actions
onto the real cache, the first 3 actions would likely work fine.
The last (second CAS) however would not, since it never got a real
updated $token from the real cache.
To work around this problem, all get() calls will return a unique
CAS token and store the value-at-that-time associated with that
token. All we have to do when we want to write the data to real cache
is, right before was CAS for real, get the value & (real) cas token
from storage & compare that value to the one we had stored. If that
checks out, we can safely resume the CAS with the real token we just
received.
{@inheritdoc}
public cas ( $token, $key, $value, $expire ) |