#future #retry #backoff #io-error

futures-backoff

基于 futures 的异步重试策略

1 个不稳定版本

使用旧的 Rust 2015

0.1.0 2018年3月22日

#20#backoff

Download history 149/week @ 2023-11-27 141/week @ 2023-12-04 172/week @ 2023-12-11 123/week @ 2023-12-18 13/week @ 2023-12-25 107/week @ 2024-01-08 160/week @ 2024-01-15 325/week @ 2024-01-22 267/week @ 2024-01-29 319/week @ 2024-02-05 262/week @ 2024-02-12 265/week @ 2024-02-19 148/week @ 2024-02-26 103/week @ 2024-03-04 50/week @ 2024-03-11

572 每月下载量
3 个crate中使用(通过 spectacles-brokers

MIT 许可证

25KB
545

futures-backoff

基于 futures 的异步重试策略。

Build Status dependency status

文档

安装

将以下内容添加到您的 Cargo.toml

[dependencies]
futures-backoff = "0.1"

示例

extern crate futures;
extern crate futures_backoff;

use futures::{Future, future};
use futures_backoff::retry;

fn main() {
    let future = retry(|| {
        // do some real-world stuff here...
        future::ok::<u32, ::std::io::Error>(42)
    });

    let result = future.wait();

    assert_eq!(result, Ok(42));
}

lib.rs:

此库为与流行的 futures crate 一起使用提供了异步重试策略。

安装

将以下内容添加到您的 Cargo.toml

[dependencies]
futures-backoff = "0.1"

示例

extern crate futures;
extern crate futures_backoff;

use futures::{Future, future};
use futures_backoff::retry;

fn main() {
    let future = retry(|| {
        // do some real-world stuff here...
        future::ok::<u32, ::std::io::Error>(42)
    });

    let result = future.wait();

    assert_eq!(result.unwrap(), 42);
}

依赖项

~420–610KB