Metaphore\Ttl::getRealTtl PHP Method

getRealTtl() public method

Get time how log it's really cached in cache store.
public getRealTtl ( ) : integer
return integer
    public function getRealTtl()
    {
        // $grace_ttl added, so stale result might be served if needed
        return $this->getTtl() + $this->getGraceTtl();
    }

Usage Example

Beispiel #1
0
 /**
  * Sets result. Does not use anti-dogpile-effect mechanism. Use cache() instead for this.
  *
  * @param string
  * @param mixed
  * @param int|\Metaphore\Ttl
  */
 public function setResult($key, $result, $ttl)
 {
     if (!$ttl instanceof Ttl) {
         $ttl = new Ttl($ttl);
     }
     $expirationTimestamp = time() + $ttl->getTtl();
     $value = new Value($result, $expirationTimestamp);
     $this->valueStore->set($key, $value, $ttl->getRealTtl());
 }