Allows any action to be retried in case of an exception.
This class can be parametrized with a strategy, which will be followed to determine whether or not the action should be retried.
int
int
\Cake\Core\Retry\RetryStrategyInterface
The strategy to follow should the executed action fail.
__construct(\Cake\Core\Retry\RetryStrategyInterface $strategy, int $maxRetries)
Creates the CommandRetry object with the given strategy and retry count
\Cake\Core\Retry\RetryStrategyInterface
$strategy The strategy to follow should the action fail
int
$maxRetries optional The maximum number of retry attempts allowed
getRetries()
Returns the last number of retry attemps.
int
run(callable $action)
The number of retries to perform in case of failure
callable
$action The callable action to execute with a retry strategy
mixed
The return value of the passed action callable
Exception
int
int
The strategy to follow should the executed action fail.
\Cake\Core\Retry\RetryStrategyInterface
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Core.Retry.CommandRetry.html