Exemplo n.º 1
0
 /**
  * Do the actual async bus purge of a key
  *
  * This must set the key to "PURGED:<UNIX timestamp>"
  *
  * @param string $key Cache key
  * @param integer $ttl How long to keep the tombstone [seconds]
  * @return bool Success
  */
 protected function relayPurge($key, $ttl)
 {
     $event = $this->cache->modifySimpleRelayEvent(array('cmd' => 'set', 'key' => $key, 'val' => 'PURGED:$UNIXTIME$', 'ttl' => max($ttl, 1), 'sbt' => true));
     $ok = $this->relayer->notify("{$this->pool}:purge", $event);
     if (!$ok) {
         $this->lastRelayError = self::ERR_RELAY;
     }
     return $ok;
 }
Exemplo n.º 2
0
 /**
  * Do the actual async bus delete of a key
  *
  * @param string $key Cache key
  * @return bool Success
  */
 protected function relayDelete($key)
 {
     $event = $this->cache->modifySimpleRelayEvent(array('cmd' => 'delete', 'key' => $key));
     $ok = $this->relayer->notify("{$this->pool}:purge", $event);
     if (!$ok) {
         $this->lastRelayError = self::ERR_RELAY;
     }
     return $ok;
 }