#[non_exhaustive]pub struct RetryPolicy {
pub minimum_backoff: Option<Duration>,
pub maximum_backoff: Option<Duration>,
/* private fields */
}Expand description
A policy that specifies how Pub/Sub retries message delivery.
Retry delay will be exponential based on provided minimum and maximum backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message.
Retry Policy is implemented on a best effort basis. At times, the delay between consecutive deliveries may not match the configuration. That is, delay can be more or less than configured backoff.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.minimum_backoff: Option<Duration>Optional. The minimum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 10 seconds.
maximum_backoff: Option<Duration>Optional. The maximum delay between consecutive deliveries of a given message. Value should be between 0 and 600 seconds. Defaults to 600 seconds.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn set_minimum_backoff<T>(self, v: T) -> Self
pub fn set_minimum_backoff<T>(self, v: T) -> Self
Sets the value of minimum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_minimum_backoff(Duration::default()/* use setters */);Sourcepub fn set_or_clear_minimum_backoff<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_minimum_backoff<T>(self, v: Option<T>) -> Self
Sets or clears the value of minimum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_or_clear_minimum_backoff(Some(Duration::default()/* use setters */));
let x = RetryPolicy::new().set_or_clear_minimum_backoff(None::<Duration>);Sourcepub fn set_maximum_backoff<T>(self, v: T) -> Self
pub fn set_maximum_backoff<T>(self, v: T) -> Self
Sets the value of maximum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_maximum_backoff(Duration::default()/* use setters */);Sourcepub fn set_or_clear_maximum_backoff<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_maximum_backoff<T>(self, v: Option<T>) -> Self
Sets or clears the value of maximum_backoff.
§Example
use wkt::Duration;
let x = RetryPolicy::new().set_or_clear_maximum_backoff(Some(Duration::default()/* use setters */));
let x = RetryPolicy::new().set_or_clear_maximum_backoff(None::<Duration>);Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
Source§fn default() -> RetryPolicy
fn default() -> RetryPolicy
Source§impl Message for RetryPolicy
impl Message for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
Source§fn eq(&self, other: &RetryPolicy) -> bool
fn eq(&self, other: &RetryPolicy) -> bool
self and other values to be equal, and is used by ==.