Trait Yiisoft\Mutex\RetryAcquireTrait
| Implemented by | Yiisoft\Mutex\Mutex |
|---|
Allows retrying acquire with a certain timeout.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| withRetryDelay() | Returns a new instance with the specified retry delay. | Yiisoft\Mutex\RetryAcquireTrait |
Method Details
Returns a new instance with the specified retry delay.
| public self withRetryDelay ( integer $retryDelay ) | ||
| $retryDelay | integer |
Number of milliseconds between each try until specified timeout times out. By default, it is 50 milliseconds - it means that we may try to acquire lock up to 20 times per second. |
public function withRetryDelay(int $retryDelay): self
{
if ($retryDelay < 1) {
throw new InvalidArgumentException(
"Retry delay value must be a positive number greater than zero, \"$retryDelay\" is received.",
);
}
$new = clone $this;
$new->retryDelay = $retryDelay;
return $new;
}
Signup or Login in order to comment.