Create new Gapic::Common::PollingHarness instance.
Parameters
retry_policy (Gapic::Common::RetryPolicy) (defaults to: nil) — The retry policy to
use. If not provided, a new retry policy is constructed from the
given kwargs.
kwargs (keywords) — Keyword arguments used to create a new retry
policy. See RetryPolicy#initialize.
Perform polling with exponential backoff. Repeatedly calls the given
block until it returns a result other than the given sentinel value
(normally nil), then returns that final result.
Uses the retry policy regulate retries, including delays between tries,
retriable errors, and final timeout. If an error code other than those
listed in RetryPolicy#retry_codes is raised, it is propagated out. If
the timeout expires, the given timeout result (normally nil) is
returned.
Parameters
wait_sentinel (Object) (defaults to: nil) — The return value that should signal the
polling harness to continue waiting. Any other value is treated as
a real result and returned. Defaults to nil.
timeout_result (Object) (defaults to: nil) — The result to return if timeout occurs.
Defaults to nil.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# gapic-common - Class Gapic::Common::PollingHarness (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/gapic-common/latest/Gapic-Common-PollingHarness)\n- [1.0.1](/ruby/docs/reference/gapic-common/1.0.1/Gapic-Common-PollingHarness)\n- [0.26.0](/ruby/docs/reference/gapic-common/0.26.0/Gapic-Common-PollingHarness)\n- [0.25.0](/ruby/docs/reference/gapic-common/0.25.0/Gapic-Common-PollingHarness)\n- [0.24.0](/ruby/docs/reference/gapic-common/0.24.0/Gapic-Common-PollingHarness) \nReference documentation and code samples for the gapic-common class Gapic::Common::PollingHarness.\n\nProvides a generic mechanism for periodic polling an operation.\n\n\nPolling intervals are calculated from the provided retry policy.\n\n\u003cbr /\u003e\n\nSupports exponential backoff via `multiplier`, and automatically\nretries gRPC errors listed in `retry_codes`. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #initialize\n\n def initialize(retry_policy: nil, **kwargs) -\u003e PollingHarness\n\nCreate new Gapic::Common::PollingHarness instance. \n**Parameters**\n\n- **retry_policy** ([Gapic::Common::RetryPolicy](./Gapic-Common-RetryPolicy)) *(defaults to: nil)* --- The retry policy to use. If not provided, a new retry policy is constructed from the given kwargs.\n- **kwargs** (keywords) --- Keyword arguments used to create a new retry policy. See [RetryPolicy#initialize](/ruby/docs/reference/gapic-common/latest/Gapic-Common-RetryPolicy#Gapic__Common__RetryPolicy_initialize_instance_ \"Gapic::Common::RetryPolicy#initialize (method)\"). \n**Returns**\n\n- ([PollingHarness](./Gapic-Common-PollingHarness)) --- a new instance of PollingHarness\n\n### #retry_policy\n\n def retry_policy() -\u003e Gapic::Common::RetryPolicy\n\n**Returns**\n\n- ([Gapic::Common::RetryPolicy](./Gapic-Common-RetryPolicy)) --- The retry policy associated with this instance.\n\n### #wait\n\n def wait(wait_sentinel: nil, timeout_result: nil, mock_delay: false)\n\nPerform polling with exponential backoff. Repeatedly calls the given\nblock until it returns a result other than the given sentinel value\n(normally `nil`), then returns that final result.\n\n\n\u003cbr /\u003e\n\nUses the retry policy regulate retries, including delays between tries,\nretriable errors, and final timeout. If an error code other than those\nlisted in [RetryPolicy#retry_codes](/ruby/docs/reference/gapic-common/latest/Gapic-Common-RetryPolicy#Gapic__Common__RetryPolicy_retry_codes_instance_ \"Gapic::Common::RetryPolicy#retry_codes (method)\") is raised, it is propagated out. If\nthe timeout expires, the given timeout result (normally `nil`) is\nreturned. \n**Parameters**\n\n- **wait_sentinel** (Object) *(defaults to: nil)* --- The return value that should signal the polling harness to continue waiting. Any other value is treated as a real result and returned. Defaults to `nil`.\n- **timeout_result** (Object) *(defaults to: nil)* --- The result to return if timeout occurs. Defaults to `nil`."]]