function ZookeeperStore::getUniqueToken
2 calls to ZookeeperStore::getUniqueToken()
- ZookeeperStore::exists in vendor/
symfony/ lock/ Store/ ZookeeperStore.php - Returns whether or not the resource exists in the storage.
- ZookeeperStore::save in vendor/
symfony/ lock/ Store/ ZookeeperStore.php - Stores the resource if it's not locked by someone else.
File
-
vendor/
symfony/ lock/ Store/ ZookeeperStore.php, line 146
Class
- ZookeeperStore
- ZookeeperStore is a PersistingStoreInterface implementation using Zookeeper as store engine.
Namespace
Symfony\Component\Lock\StoreCode
private function getUniqueToken(Key $key) : string {
if (!$key->hasState(self::class)) {
$token = base64_encode(random_bytes(32));
$key->setState(self::class, $token);
}
return $key->getState(self::class);
}