* @param array $opts Options map:
* - checkKeys: List of "check" keys. The key at $key will be seen as invalid when either
* touchCheckKey() or resetCheckKey() is called on any of these keys.
- * Default: [];
- * - lowTTL: Consider pre-emptive updates when the current TTL (sec) of the key is less than
- * this. It becomes more likely over time, becoming a certainty once the key is expired.
- * Default: WANObjectCache::LOW_TTL seconds.
+ * Default: [].
+ * - lowTTL: Consider pre-emptive updates when the current TTL (seconds) of the key is less
+ * than this. It becomes more likely over time, becoming certain once the key is expired.
+ * Default: WANObjectCache::LOW_TTL.
* - lockTSE: If the key is tombstoned or expired (by checkKeys) less than this many seconds
* ago, then try to have a single thread handle cache regeneration at any given time.
* Other threads will try to use stale values if possible. If, on miss, the time since
* stampedes cannot happen if the value falls out of cache. This can be used as insurance
* against cache regeneration becoming very slow for some reason (greater than the TTL).
* Default: null.
- * - pcTTL: Process cache the value in this PHP instance with this TTL. This avoids
- * network I/O when a key is read several times. This will not cache if the callback
- * returns false however. Note that any purges will not be seen while process cached;
+ * - pcTTL: Process cache the value in this PHP instance for this many seconds. This avoids
+ * network I/O when a key is read several times. This will not cache when the callback
+ * returns false, however. Note that any purges will not be seen while process cached;
* since the callback should use slave DBs and they may be lagged or have snapshot
* isolation anyway, this should not typically matter.
* Default: WANObjectCache::TTL_UNCACHEABLE.
* however, as this reduces compatibility (due to serialization).
* Default: null.
* @return mixed Value found or written to the key
+ * @note Callable type hints are not used to avoid class-autoloading
*/
final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) {
$pcTTL = isset( $opts['pcTTL'] ) ? $opts['pcTTL'] : self::TTL_UNCACHEABLE;
* - minTime: Treat values older than this UNIX timestamp as not existing. Default: null.
* @param float &$asOf Cache generation timestamp of returned value [returned]
* @return mixed
+ * @note Callable type hints are not used to avoid class-autoloading
*/
protected function doGetWithSetCallback( $key, $ttl, $callback, array $opts, &$asOf = null ) {
$lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( self::LOW_TTL, $ttl );