Reference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class Retry.
Retry implementation.
UnlikeExponentialBackoff, Retry requires an implementor
to supply wait times for each iteration.
Namespace
Google \ Cloud \ Core
Methods
__construct
Parameters
Name
Description
retries
int|null
Maximum number of retries for a failed request.
delayFunction
callable
A function returning an array of format['seconds' => (int >= 0), 'nanos' => (int >= 0)] specifying how
long an operation should pause before retrying. Should accept a
single argument of type\Exception`.
retryFunction
callable
[optional] returns bool for whether or not
to retry.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud PHP shared dependency, providing functionality useful to all components. Client - Class Retry (1.64.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.64.2 (latest)](/php/docs/reference/cloud-core/latest/Retry)\n- [1.64.1](/php/docs/reference/cloud-core/1.64.1/Retry)\n- [1.63.0](/php/docs/reference/cloud-core/1.63.0/Retry)\n- [1.62.3](/php/docs/reference/cloud-core/1.62.3/Retry)\n- [1.61.0](/php/docs/reference/cloud-core/1.61.0/Retry)\n- [1.60.1](/php/docs/reference/cloud-core/1.60.1/Retry)\n- [1.59.1](/php/docs/reference/cloud-core/1.59.1/Retry)\n- [1.58.2](/php/docs/reference/cloud-core/1.58.2/Retry)\n- [1.53.0](/php/docs/reference/cloud-core/1.53.0/Retry)\n- [1.52.11](/php/docs/reference/cloud-core/1.52.11/Retry)\n- [1.51.2](/php/docs/reference/cloud-core/1.51.2/Retry)\n- [1.50.0](/php/docs/reference/cloud-core/1.50.0/Retry)\n- [1.49.3](/php/docs/reference/cloud-core/1.49.3/Retry)\n- [1.48.1](/php/docs/reference/cloud-core/1.48.1/Retry) \nReference documentation and code samples for the Google Cloud PHP shared dependency, providing functionality useful to all components. Client class Retry.\n\nRetry implementation.\n\nUnlike [ExponentialBackoff](/php/docs/reference/cloud-core/latest/ExponentialBackoff), Retry requires an implementor\nto supply wait times for each iteration.\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Core\n\nMethods\n-------\n\n### __construct\n\n### execute\n\nExecutes the retry process.\n\n### setDelayFunction\n\nConstants\n---------\n\n### RETRY_HEADER_KEY\n\n Value: 'x-goog-api-client'"]]