PHP Class Google\Cloud\ExponentialBackoff

Show file Open project: GoogleCloudPlatform/gcloud-php Class Usage Examples

Public Methods

Method Description
__construct ( integer $retries = null, callable $retryFunction = null )
execute ( callable $function, array $arguments = [] ) : mixed Executes the retry process.
setDelayFunction ( callable $delayFunction ) : void

Private Methods

Method Description
calculateDelay ( integer $attempt ) : integer Calculates exponential delay.

Method Details

__construct() public method

public __construct ( integer $retries = null, callable $retryFunction = null )
$retries integer [optional] Number of retries for a failed request.
$retryFunction callable [optional] returns bool for whether or not to retry

execute() public method

Executes the retry process.
public execute ( callable $function, array $arguments = [] ) : mixed
$function callable
$arguments array [optional]
return mixed

setDelayFunction() public method

public setDelayFunction ( callable $delayFunction ) : void
$delayFunction callable
return void