pub struct RetryNode<N, Context, A = DefaultAction>{ /* private fields */ }Expand description
A node that retries another node if it fails
Implementations§
Source§impl<N, Context, A> RetryNode<N, Context, A>
impl<N, Context, A> RetryNode<N, Context, A>
Sourcepub fn with_constant_backoff(
inner_node: N,
max_retries: usize,
delay: Duration,
) -> Self
pub fn with_constant_backoff( inner_node: N, max_retries: usize, delay: Duration, ) -> Self
Create a new retry node with a constant backoff
Sourcepub fn with_linear_backoff(
inner_node: N,
max_retries: usize,
base: Duration,
increment: Duration,
) -> Self
pub fn with_linear_backoff( inner_node: N, max_retries: usize, base: Duration, increment: Duration, ) -> Self
Create a new retry node with linear backoff
Sourcepub fn with_exponential_backoff(
inner_node: N,
max_retries: usize,
base: Duration,
max: Duration,
) -> Self
pub fn with_exponential_backoff( inner_node: N, max_retries: usize, base: Duration, max: Duration, ) -> Self
Create a new retry node with exponential backoff
Trait Implementations§
Source§impl<N, Context, A> Node<Context, A> for RetryNode<N, Context, A>
impl<N, Context, A> Node<Context, A> for RetryNode<N, Context, A>
Source§fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<NodeOutcome<Self::Output, A>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut Context,
) -> Pin<Box<dyn Future<Output = Result<NodeOutcome<Self::Output, A>, FloxideError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the node asynchronously
Auto Trait Implementations§
impl<N, Context, A> Freeze for RetryNode<N, Context, A>where
N: Freeze,
impl<N, Context, A = DefaultAction> !RefUnwindSafe for RetryNode<N, Context, A>
impl<N, Context, A> Send for RetryNode<N, Context, A>
impl<N, Context, A> Sync for RetryNode<N, Context, A>
impl<N, Context, A> Unpin for RetryNode<N, Context, A>
impl<N, Context, A = DefaultAction> !UnwindSafe for RetryNode<N, Context, A>
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
Mutably borrows from an owned value. Read more