cas() public method

This operation fails (returns false) if the CAS token didn't match with what's currently in cache, when a new value has been written to cache after we've fetched it. If the operation succeeds, true will be returned.
public cas ( mixed $token, string $key, mixed $value, integer $expire ) : boolean
$token mixed Token received from get() or getMulti()
$key string
$value mixed
$expire integer Time when item falls out of the cache: 0 = permanent (doesn't expires); under 2592000 (30 days) = relative time, in seconds from now; over 2592000 = absolute time, unix timestamp
return boolean
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function cas($token, $key, $value, $expire = 0)
 {
     return $this->cache->cas($token, $key, $value, $expire);
 }