+ * Another use case is when there are no applicable "last modified" fields in the DB,
+ * and there are too many dependencies for explicit purges to be viable, and the rate of
+ * change to relevant content is unstable, and it is highly valued to have the cached value
+ * be as up-to-date as possible.
+ *
+ * Example usage:
+ * @code
+ * $query = "<some complex query>";
+ * $idListFromComplexQuery = $cache->getWithSetCallback(
+ * $cache->makeKey( 'complex-graph-query', $hashOfQuery ),
+ * GraphQueryClass::STARTING_TTL,
+ * function ( $oldValue, &$ttl, array &$setOpts, $oldAsOf ) use ( $query, $cache ) {
+ * $gdb = $this->getReplicaGraphDbConnection();
+ * // Account for any snapshot/replica DB lag
+ * $setOpts += GraphDatabase::getCacheSetOptions( $gdb );
+ *
+ * $newList = iterator_to_array( $gdb->query( $query ) );
+ * sort( $newList, SORT_NUMERIC ); // normalize
+ *
+ * $minTTL = GraphQueryClass::MIN_TTL;
+ * $maxTTL = GraphQueryClass::MAX_TTL;
+ * if ( $oldValue !== false ) {
+ * // Note that $oldAsOf is the last time this callback ran
+ * $ttl = ( $newList === $oldValue )
+ * // No change: cache for 150% of the age of $oldValue
+ * ? $cache->adaptiveTTL( $oldAsOf, $maxTTL, $minTTL, 1.5 )
+ * // Changed: cache for %50 of the age of $oldValue
+ * : $cache->adaptiveTTL( $oldAsOf, $maxTTL, $minTTL, .5 );
+ * }
+ *
+ * return $newList;
+ * },
+ * [
+ * // Keep stale values around for doing comparisons for TTL calculations.
+ * // High values improve long-tail keys hit-rates, though might waste space.
+ * 'staleTTL' => GraphQueryClass::GRACE_TTL
+ * ]
+ * );
+ * @endcode
+ *