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.
__construct() ¶ public
__construct(\Cake\Core\Retry\RetryStrategyInterface $strategy, int $retries)
Creates the CommandRetry object with the given strategy and retry count
The strategy to follow should the action fail
The number of times the action has been already called
run() ¶ public
The number of retries to perform in case of failure
The callable action to execute with a retry strategy
The return value of the passed action callable