src/Connector/ConnectionContext.php
public function retry(callable $callback)
    {
        $userHandlerCloned = $providerHandlerCloned = false;

        return \ScriptFUSION\Retry\retry(
            $this->maxFetchAttempts,
            $callback,
            function (\Exception $exception) use (&$userHandlerCloned, &$providerHandlerCloned) {
                // Throw exception instead of retrying, if unrecoverable.
                if (!$exception instanceof RecoverableConnectorException) {
                    throw $exception;
                }

                // Call provider's exception handler, if defined.
                if ($this->resourceFetchExceptionHandler) {
                    self::invokeHandler($this->resourceFetchExceptionHandler, $exception, $providerHandlerCloned);
                }

                // Call user's exception handler.
                self::invokeHandler($this->fetchExceptionHandler, $exception, $userHandlerCloned);
            }
        );
    }
public function retry(callable $callback)
    {
        $userHandlerCloned = $providerHandlerCloned = false;

        return \ScriptFUSION\Retry\retry(
            $this->maxFetchAttempts,
            $callback,
            function (\Exception $exception) use (&$userHandlerCloned, &$providerHandlerCloned) {
                // Throw exception instead of retrying, if unrecoverable.
                if (!$exception instanceof RecoverableConnectorException) {
                    throw $exception;
                }

                // Call provider's exception handler, if defined.
                if ($this->resourceFetchExceptionHandler) {
                    self::invokeHandler($this->resourceFetchExceptionHandler, $exception, $providerHandlerCloned);
                }

                // Call user's exception handler.
                self::invokeHandler($this->fetchExceptionHandler, $exception, $userHandlerCloned);
            }
        );
    }
public function retry ( callable $ callback ) { $ userHandlerCloned = $ providerHandlerCloned = false ; return \ ScriptFUSION \ Retry \ retry ( $ this -> maxFetchAttempts , $ callback , function ( \ Exception $ exception ) use ( & $ userHandlerCloned , & $ providerHandlerCloned ) { // Throw exception instead of retrying, if unrecoverable. if ( ! $ exception instanceof RecoverableConnectorException ) { throw $ exception ; } // Call provider's exception handler, if defined. if ( $ this -> resourceFetchExceptionHandler ) { self :: invokeHandler ( $ this -> resourceFetchExceptionHandler , $ exception , $ providerHandlerCloned ) ; } // Call user's exception handler. self :: invokeHandler ( $ this -> fetchExceptionHandler , $ exception , $ userHandlerCloned ) ; } ) ; }
Retries the specified callback a predefined number of times with a predefined exception handler.

@param callable $callback Callback.

@return mixed The result of the callback invocation.
Retries the specified callback a predefined number of times with a predefined exception handler .