Construct a polling policy from existing Retry and Backoff policies.
A polling policy can be built by composing a retry and backoff policy. For example, to create a polling policy that "retries N times, waiting a fixed
period between retries" you could compose the "try N times" retry policy with the "wait a fixed period between retries".
This class makes it easier to create such composed polling policies.
[[["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-14 UTC."],[[["\u003cp\u003eThe page provides documentation for the \u003ccode\u003eGenericPollingPolicy\u003c/code\u003e class in the Google Cloud Bigtable C++ library, with versioned links ranging from 2.11.0 to 2.37.0-rc (latest).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGenericPollingPolicy\u003c/code\u003e allows users to define custom polling behaviors by composing retry and backoff policies, offering flexibility in handling retries and wait times between them.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes functions like \u003ccode\u003eclone()\u003c/code\u003e, \u003ccode\u003eSetup()\u003c/code\u003e, \u003ccode\u003eIsPermanentError()\u003c/code\u003e, \u003ccode\u003eOnFailure()\u003c/code\u003e, \u003ccode\u003eExhausted()\u003c/code\u003e, and \u003ccode\u003eWaitPeriod()\u003c/code\u003e to manage the polling process, retry conditions, and wait times.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructors for the \u003ccode\u003eGenericPollingPolicy\u003c/code\u003e, one for internal \u003ccode\u003eRPCPolicyParameters\u003c/code\u003e and one for an explicit \u003ccode\u003eRetry\u003c/code\u003e and \u003ccode\u003eBackoff\u003c/code\u003e, allowing for different levels of customization when implementing the class.\u003c/p\u003e\n"],["\u003cp\u003eThe class contains legacy methods \u003ccode\u003eIsPermanentError(grpc::Status const &)\u003c/code\u003e and \u003ccode\u003eOnFailure(grpc::Status const &)\u003c/code\u003e which are set to be removed in the future.\u003c/p\u003e\n"]]],[],null,["# Class GenericPollingPolicy<Retry, Backoff> (2.23.0)\n\nVersion 2.23.0keyboard_arrow_down\n\n- [2.42.0-rc (latest)](/cpp/docs/reference/bigtable/latest/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.41.0](/cpp/docs/reference/bigtable/2.41.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.40.0](/cpp/docs/reference/bigtable/2.40.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.39.0](/cpp/docs/reference/bigtable/2.39.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.38.0](/cpp/docs/reference/bigtable/2.38.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.37.0](/cpp/docs/reference/bigtable/2.37.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.36.0](/cpp/docs/reference/bigtable/2.36.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.35.0](/cpp/docs/reference/bigtable/2.35.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.34.0](/cpp/docs/reference/bigtable/2.34.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.33.0](/cpp/docs/reference/bigtable/2.33.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.32.0](/cpp/docs/reference/bigtable/2.32.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.31.0](/cpp/docs/reference/bigtable/2.31.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.30.0](/cpp/docs/reference/bigtable/2.30.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.29.0](/cpp/docs/reference/bigtable/2.29.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.28.0](/cpp/docs/reference/bigtable/2.28.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.27.0](/cpp/docs/reference/bigtable/2.27.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.26.0](/cpp/docs/reference/bigtable/2.26.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.25.1](/cpp/docs/reference/bigtable/2.25.1/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.24.0](/cpp/docs/reference/bigtable/2.24.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.23.0](/cpp/docs/reference/bigtable/2.23.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.22.1](/cpp/docs/reference/bigtable/2.22.1/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.21.0](/cpp/docs/reference/bigtable/2.21.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.20.0](/cpp/docs/reference/bigtable/2.20.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.19.0](/cpp/docs/reference/bigtable/2.19.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.18.0](/cpp/docs/reference/bigtable/2.18.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.17.0](/cpp/docs/reference/bigtable/2.17.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.16.0](/cpp/docs/reference/bigtable/2.16.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.15.1](/cpp/docs/reference/bigtable/2.15.1/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.14.0](/cpp/docs/reference/bigtable/2.14.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.13.0](/cpp/docs/reference/bigtable/2.13.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.12.0](/cpp/docs/reference/bigtable/2.12.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy)\n- [2.11.0](/cpp/docs/reference/bigtable/2.11.0/classgoogle_1_1cloud_1_1bigtable_1_1GenericPollingPolicy) \nConstruct a polling policy from existing Retry and Backoff policies. \nA polling policy can be built by composing a retry and backoff policy. For example, to create a polling policy that \"retries N times, waiting a fixed\nperiod between retries\" you could compose the \"try N times\" retry policy with the \"wait a fixed period between retries\".\n\nThis class makes it easier to create such composed polling policies.\n\nConstructors\n------------\n\n### GenericPollingPolicy(internal::RPCPolicyParameters)\n\n### GenericPollingPolicy(Retry, Backoff)\n\nFunctions\n---------\n\n### virtual clone() const\n\nReturn a new copy of this object. \nTypically implemented as \n\n return std::unique_ptr\u003cPollingPolicy\u003e(new Foo(*this));\n\n### virtual Setup(grpc::ClientContext \\&)\n\n### virtual IsPermanentError(Status const \\&)\n\nReturn true if `status` represents a permanent error that cannot be retried.\n\n### virtual OnFailure(Status const \\&)\n\nHandle an RPC failure.\n\n### virtual Exhausted()\n\nReturn true if we cannot try again.\n\n### virtual WaitPeriod()\n\nReturn for how long we should wait before trying again.\n\n### virtual IsPermanentError(grpc::Status const \\&)\n\nReturn true if `status` represents a permanent error that cannot be retried. \nTODO(#2344): remove `grpc::Status` version.\n\n### virtual OnFailure(grpc::Status const \\&)\n\nHandle an RPC failure. \nTODO(#2344): remove `grpc::Status` version."]]