Skip to main content

Module polling_error_policy

Module polling_error_policy 

Source
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§

Aip194Strict
A polling policy that strictly follows AIP-194.
AlwaysContinue
A polling policy that continues on any error.
Exhausted
Indicates that a retry or polling loop has been exhausted.
LimitedAttemptCount
A polling policy decorator that limits the number of attempts.
LimitedElapsedTime
A polling policy decorator that limits the total time in the polling loop.
PollingErrorPolicyArg
A helper type to use PollingErrorPolicy in client and request options.

Traits§

PollingErrorPolicy
Determines how errors are handled in the polling loop.
PollingErrorPolicyExt
Extension trait for PollingErrorPolicy