__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Aws\DynamoDb;
use Aws\DynamoDb\Exception\DynamoDbException;
/**
* The locking connection adds locking logic to the read operation.
*/
class LockingSessionConnection extends StandardSessionConnection
{
public function __construct(DynamoDbClient $client, array $config = [])
{
parent::__construct($client, $config);
}
/**
* {@inheritdoc}
* Retries the request until the lock can be acquired
*/
public function read($id)
{
// Create the params for the UpdateItem operation so that a lock can be
// set and item returned (via ReturnValues) in a one, atomic operation.
$params = [
'TableName' => $this->getTableName(),
'Key' => $this->formatKey($id),
'Expected' => ['lock' => ['Exists' => false]],
'AttributeUpdates' => ['lock' => ['Value' => ['N' => '1']]],
'ReturnValues' => 'ALL_NEW',
];
// Acquire the lock and fetch the item data.
$timeout = time() + $this->getMaxLockWaitTime();
while (true) {
try {
$item = [];
$result = $this->client->updateItem($params);
if (isset($result['Attributes'])) {
foreach ($result['Attributes'] as $key => $value) {
$item[$key] = current($value);
}
}
return $item;
} catch (DynamoDbException $e) {
if ($e->getAwsErrorCode() === 'ConditionalCheckFailedException'
&& time() < $timeout
) {
usleep(rand(
$this->getMinLockRetryMicrotime(),
$this->getMaxLockRetryMicrotime()
));
} else {
break;
}
}
}
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Exception | Folder | 0777 |
|
|
| BinaryValue.php | File | 743 B | 0777 |
|
| DynamoDbClient.php | File | 13.58 KB | 0777 |
|
| LockingSessionConnection.php | File | 1.89 KB | 0777 |
|
| Marshaler.php | File | 9.52 KB | 0777 |
|
| NumberValue.php | File | 552 B | 0777 |
|
| SessionConnectionConfigTrait.php | File | 5.85 KB | 0777 |
|
| SessionConnectionInterface.php | File | 1017 B | 0777 |
|
| SessionHandler.php | File | 7.85 KB | 0777 |
|
| SetValue.php | File | 960 B | 0777 |
|
| StandardSessionConnection.php | File | 4.46 KB | 0777 |
|
| WriteRequestBatch.php | File | 9.34 KB | 0777 |
|