MatthiasMullie\Scrapbook\Scale\StampedeProtector::stampedeKey PHP Method

stampedeKey() protected method

To figure out if something has recently been requested already (and is likely in the process of being recalculated), we'll temporarily write to another key, so follow-up requests know another process is likely already re-processing the value.
protected stampedeKey ( string $key ) : string
$key string
return string
    protected function stampedeKey($key)
    {
        $suffix = '.stampede';
        if (substr($key, -strlen($suffix)) === $suffix) {
            throw new InvalidKey("Invalid key: {$key}. Keys with suffix '{$suffix}' are reserved.");
        }
        return $key . $suffix;
    }