pub fn with_retry<N>(node: N, policy: RetryPolicy) -> RetryNode<N>Expand description
Wrap an existing node with retry behavior according to the given policy.
§Example
use floxide_core::*;
use std::time::Duration;
// Define a policy: up to 3 attempts, exponential backoff 100ms→200ms→400ms
let policy = RetryPolicy::new(
3,
Duration::from_millis(100),
Duration::from_secs(1),
BackoffStrategy::Exponential,
RetryError::All,
);
let my_node = FooNode::new();
let retry_node = with_retry(my_node, policy.clone());In future macro syntax you could write:
ⓘ
#[node(retry = "my_policy")]
foo: FooNode;