pub struct ActivityRetryPolicy {
pub max_attempts: Option<u32>,
pub backoff: Option<ActivityBackoff>,
pub non_retryable_error_types: Vec<String>,
}Expand description
Durable server-side retry policy for one activity execution.
Fields§
§max_attempts: Option<u32>§backoff: Option<ActivityBackoff>§non_retryable_error_types: Vec<String>Implementations§
Source§impl ActivityRetryPolicy
impl ActivityRetryPolicy
Sourcepub fn new(max_attempts: u32) -> Self
pub fn new(max_attempts: u32) -> Self
Start a policy with a finite attempt budget, including the first attempt.
Sourcepub fn backoff_intervals(
self,
intervals: impl IntoIterator<Item = Duration>,
) -> Self
pub fn backoff_intervals( self, intervals: impl IntoIterator<Item = Duration>, ) -> Self
Preserve the complete explicit list independently of the attempt budget.
Unused entries remain part of the policy compared during replay.
Set explicit durable retry intervals. Each positive fractional second
is rounded up when encoded: Duration::from_millis(100) becomes one
second. Zero stays zero. Queue latency can delay the next attempt further.
Sourcepub fn exponential_backoff(
self,
initial_interval: Duration,
coefficient: u32,
maximum_interval: Option<Duration>,
) -> Self
pub fn exponential_backoff( self, initial_interval: Duration, coefficient: u32, maximum_interval: Option<Duration>, ) -> Self
Generate durable retry intervals from initial_interval and coefficient.
Each interval is capped by maximum_interval, when present, then rounded
up to whole seconds. A 100 ms interval or cap therefore encodes one second.
Zero stays zero. This policy is separate from HTTP transport retries.
pub fn non_retryable_error_type(self, error_type: impl Into<String>) -> Self
pub fn non_retryable_error_types( self, error_types: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Trait Implementations§
Source§impl Clone for ActivityRetryPolicy
impl Clone for ActivityRetryPolicy
Source§fn clone(&self) -> ActivityRetryPolicy
fn clone(&self) -> ActivityRetryPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more