pub struct RunRetryPolicy { /* private fields */ }
Expand description
This struct represents the policy to execute retries for run closures.
Implementations§
Source§impl RunRetryPolicy
impl RunRetryPolicy
Sourcepub fn initial_delay(self, initial_interval: Duration) -> Self
pub fn initial_delay(self, initial_interval: Duration) -> Self
Initial retry delay for the first retry attempt.
Sourcepub fn exponentiation_factor(self, factor: f32) -> Self
pub fn exponentiation_factor(self, factor: f32) -> Self
Exponentiation factor to use when computing the next retry delay.
Sourcepub fn max_attempts(self, max_attempts: u32) -> Self
pub fn max_attempts(self, max_attempts: u32) -> Self
Gives up retrying when either at least the given number of attempts is reached,
or max_duration
(if set) is reached first.
Note: The number of actual retries may be higher than the provided value. This is due to the nature of the run operation, which executes the closure on the service and sends the result afterward to Restate.
Infinite retries if this field and max_duration
are unset.
Sourcepub fn max_duration(self, max_duration: Duration) -> Self
pub fn max_duration(self, max_duration: Duration) -> Self
Gives up retrying when either the retry loop lasted at least for this given max duration,
or max_attempts
(if set) is reached first.
Note: The real retry loop duration may be higher than the given duration. This is due to the nature of the run operation, which executes the closure on the service and sends the result afterward to Restate.
Infinite retries if this field and max_attempts
are unset.
Trait Implementations§
Source§impl Clone for RunRetryPolicy
impl Clone for RunRetryPolicy
Source§fn clone(&self) -> RunRetryPolicy
fn clone(&self) -> RunRetryPolicy
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RunRetryPolicy
impl Debug for RunRetryPolicy
Auto Trait Implementations§
impl Freeze for RunRetryPolicy
impl RefUnwindSafe for RunRetryPolicy
impl Send for RunRetryPolicy
impl Sync for RunRetryPolicy
impl Unpin for RunRetryPolicy
impl UnwindSafe for RunRetryPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more