}
$purgeValues[] = $purge;
}
+
return $purgeValues;
}
* - version: Integer version number signifiying the format of the value.
* Default: null
* - walltime: How long the value took to generate in seconds. Default: 0.0
+ * @codingStandardsIgnoreStart
+ * @phan-param array{lag?:int,since?:int,pending?:bool,lockTSE?:int,staleTTL?:int,creating?:bool,version?:?string,walltime?:int|float} $opts
+ * @codingStandardsIgnoreEnd
* @note Options added in 1.28: staleTTL
* @note Options added in 1.33: creating
* @note Options added in 1.34: version, walltime
* @return bool Success
+ * @suppress PhanTypeInvalidDimOffset
*/
final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) {
$now = $this->getCurrentTime();
* most sense for values that are moderately to highly expensive to regenerate and easy
* to query for dependency timestamps. The use of "pcTTL" reduces timestamp queries.
* Default: null.
+ * @codingStandardsIgnoreStart
+ * @phan-param array{checkKeys?:string[],graceTTL?:int,lockTSE?:int,busyValue?:mixed,pcTTL?:int,pcGroup?:string,version?:int,minAsOf?:int,hotTTR?:int,lowTTL?:int,ageNew?:int,staleTTL?:int,touchedCallback?:callable} $opts
+ * @codingStandardsIgnoreEnd
* @return mixed Value found or written to the key
* @note Options added in 1.28: version, busyValue, hotTTR, ageNew, pcGroup, minAsOf
* @note Options added in 1.31: staleTTL, graceTTL
* @note Options added in 1.33: touchedCallback
* @note Callable type hints are not used to avoid class-autoloading
+ * @suppress PhanTypeInvalidDimOffset
*/
final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) {
$version = $opts['version'] ?? null;
* - Cached or regenerated value version number or null if not versioned
* - Timestamp of the current cached value at the key or null if there is no value
* @note Callable type hints are not used to avoid class-autoloading
+ * @suppress PhanTypeArraySuspicious
*/
private function fetchOrRegenerate( $key, $ttl, $callback, array $opts ) {
$checkKeys = $opts['checkKeys'] ?? [];
$this->setInterimValue( $key, $value, $lockTSE, $version, $walltime );
} else {
$finalSetOpts = [
+ // @phan-suppress-next-line PhanTypeInvalidDimOffset
'since' => $setOpts['since'] ?? $preCallbackTime,
'version' => $version,
'staleTTL' => $staleTTL,
// Wildcards select all matching routes, e.g. the WAN cluster on all DCs
$ok = $this->cache->set(
"/*/{$this->cluster}/{$key}",
- $this->makePurgeValue( $this->getCurrentTime(), self::HOLDOFF_TTL_NONE ),
+ $this->makePurgeValue( $this->getCurrentTime(), $holdoff ),
$ttl
);
} else {
- // This handles the mcrouter and the single-DC case
+ // Some other proxy handles broadcasting or there is only one datacenter
$ok = $this->cache->set(
$key,
- $this->makePurgeValue( $this->getCurrentTime(), self::HOLDOFF_TTL_NONE ),
+ $this->makePurgeValue( $this->getCurrentTime(), $holdoff ),
$ttl
);
}
* - curTTL: remaining time-to-live (negative if tombstoned) or null if there is no value
* - version: value version number or null if the if there is no value
* - tombAsOf: UNIX timestamp of the tombstone or null if there is no tombstone
+ * @phan-return array{0:mixed,1:array{asOf:?mixed,curTTL:?int|float,version:?mixed,tombAsOf:?mixed}}
*/
private function unwrap( $wrapped, $now ) {
$value = false;