Expand description
Defines the types for polling error policies.
§Example
use std::time::Duration;
// Poll for at most 15 minutes or at most 50 attempts: whichever limit is
// reached first stops the polling loop.
let policy = Aip194Strict
.with_time_limit(Duration::from_secs(15 * 60))
.with_attempt_limit(50);The client libraries automatically poll long-running operations (LROs) and need to (1) distinguish between transient and permanent errors, and (2) provide a mechanism to limit the polling loop duration.
We provide a trait that applications may implement to customize the behavior of the polling loop, and some common implementations that should meet most needs.
To configure the default polling error policy for a client, use ClientBuilder::with_polling_error_policy. To configure the polling error policy used for a specific request, use RequestOptionsBuilder::with_polling_error_policy.
Structs§
- Aip194
Strict - A polling policy that strictly follows AIP-194.
- Always
Continue - A polling policy that continues on any error.
- Exhausted
- Indicates that a retry or polling loop has been exhausted.
- Limited
Attempt Count - A polling policy decorator that limits the number of attempts.
- Limited
Elapsed Time - A polling policy decorator that limits the total time in the polling loop.
- Polling
Error Policy Arg - A helper type to use PollingErrorPolicy in client and request options.
Traits§
- Polling
Error Policy - Determines how errors are handled in the polling loop.
- Polling
Error Policy Ext - Extension trait for PollingErrorPolicy