Exponential backoff implementation.

CloneableInstantiable
Constants
public Google\Cloud\Core\ExponentialBackoff::MAX_DELAY_MICROSECONDS = 60000000
Methods
public __construct( $retries = NULL, ?callable $retryFunction = NULL)
 
    public static calculateDelay( $attempt)
     

    Calculates exponential delay.

    • return int
    public execute(callable $function, array $arguments = [])
     

    Executes the retry process.

    • return mixed
    • throws Exception The last exception caught while retrying.
    public setCalcDelayFunction(callable $calcDelayFunction)
     

    If not set, defaults to using
    {@see Google\Cloud\Core\ExponentialBackoff::calculateDelay()}.

    • return void
    public setDelayFunction(callable $delayFunction)
     

    If not set, defaults to using usleep.

    • return void
    Properties
    private $calcDelayFunction
     
    • var callable|null
    private $delayFunction
     
    • var callable
    private $retries
     
    • var int
    private $retryFunction
     
    • var callable|null
    Methods
    public static calculateDelay( $attempt)
     

    Calculates exponential delay.

    • return int
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only