Skip to content

Wrapper around reqwest to allow for easy partial retries

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Funami580/reqwest-partial-retry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reqwest-partial-retry

Wrapper around reqwest to allow for easy partial retries

Features

  • Customizable retry policy
  • Customizable retry strategy
  • Customizable stream timeout
  • Retries use the Range Header if possible

Example

use futures_util::StreamExt;
use reqwest_partial_retry::ClientExt;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new().resumable();
    let request = client.get("http://httpbin.org/ip").build().unwrap();
    let mut stream = client
        .execute_resumable(request)
        .await?
        .bytes_stream_resumable();

    while let Some(item) = stream.next().await {
        println!("Bytes: {:?}", item?);
    }

    Ok(())
}

Thanks

About

Wrapper around reqwest to allow for easy partial retries

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages