async_repeat 0.1.0

Retry futures mechanism
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::{RetryStrategy, TooManyAttempts};
use std::time::Duration;

pub struct InfiniteRetryStrategy {
    pub duration_between_repeats: Duration,
}

impl RetryStrategy for InfiniteRetryStrategy {
    fn check_attempt(&mut self, _attempts_before: usize) -> Result<Duration, TooManyAttempts> {
        Ok(self.duration_between_repeats)
    }
}