• Stars
    star
    200
  • Rank 195,325 (Top 4 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ’ซ Easily retry futures ๐Ÿฆ€

๐Ÿ’ซ tryhard

Embark Embark Crates.io Docs dependency status Build status

tryhard makes it easy to retry futures that might fail. You can control the number of retries, the backoff strategy, and the max duration.

Examples

First imagine you have some async function that can fail:

async fn read_file(path: &str) -> Result<String, std::io::Error> {
    // ...
}

Calling that function and retrying at most 10 times with no delay between attempts can be done like so:

tryhard::retry_fn(|| read_file("Cargo.toml"))
    .retries(10)
    .await?;

You can also retry with a fixed delay between attempts:

tryhard::retry_fn(|| read_file("Cargo.toml"))
    .retries(10)
    .fixed_backoff(Duration::from_millis(100))
    .await?;

Or exponential backoff, where the delay doubles each time, with a max delay of 1 second:

tryhard::retry_fn(|| read_file("Cargo.toml"))
    .retries(10)
    .exponential_backoff(Duration::from_millis(10))
    .max_delay(Duration::from_secs(1))
    .await?;

See the docs for more details.

Contributing

Contributor Covenant

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

More Repositories

1

rust-gpu

๐Ÿ‰ Making Rust a first-class language and ecosystem for GPU shaders ๐Ÿšง
Rust
6,796
star
2

kajiya

๐Ÿ’ก Experimental real-time global illumination renderer ๐Ÿฆ€
Rust
4,753
star
3

wg-ui

WireGuard Web UI for self-serve client configurations, with optional auth.
Go
1,468
star
4

cargo-deny

โŒ Cargo plugin for linting your dependencies ๐Ÿฆ€
Rust
1,254
star
5

puffin

๐Ÿฆ Friendly little instrumentation profiler for Rust ๐Ÿฆ€
Rust
973
star
6

rust-ecosystem

Rust wants & tracking for Embark ๐Ÿฆ€
Rust
843
star
7

physx-rs

๐ŸŽณ Rust binding for NVIDIA PhysX ๐Ÿฆ€
Rust
646
star
8

blender-tools

๐Ÿต Embark Addon for Blender
Python
411
star
9

cargo-about

๐Ÿ“œ Cargo plugin to generate list of all licenses for a crate ๐Ÿฆ€
Rust
320
star
10

presser

A crate to help you copy things into raw buffers without invoking spooky action at a distance (undefined behavior).
Rust
157
star
11

crash-handling

Collection of crates to deal with crashes
Rust
135
star
12

poll-promise

A Rust promise for games and immediate mode GUIs
Rust
127
star
13

rpmalloc-rs

๐Ÿ rpmalloc global memory allocator for Rust ๐Ÿฆ€
Rust
126
star
14

discord-sdk

An open implementation of the Discord Game SDK in Rust
Rust
108
star
15

skyhook

Simple Python communication system for DCC's and Game Engines
Python
104
star
16

spirt

SPIR-๐Ÿ‡น: shader-focused IR to target, transform and translate from ๐Ÿฆ€
Rust
103
star
17

superluminal-perf-rs

๐Ÿ”† Superluminal Performance profiler Rust API ๐Ÿฆ€
Rust
94
star
18

ash-molten

๐ŸŒ‹ Statically linked MoltenVK for Vulkan on Mac using Ash ๐Ÿฆ€
Rust
91
star
19

cargo-deny-action

โŒ GitHub Action for cargo-deny ๐Ÿฆ€
Shell
89
star
20

cargo-fetcher

๐ŸŽ cargo plugin for quickly fetching dependencies ๐Ÿฆ€
Rust
83
star
21

mirror-mirror

๐Ÿชž Powerful reflection library for Rust
Rust
79
star
22

relnotes

Automatic GitHub Release Notes
Rust
77
star
23

opensource-template

๐ŸŒป Template for creating new repositories
74
star
24

tame-oauth

๐Ÿ” Small OAuth crate that follows the sans-io approach ๐Ÿฆ€
Rust
68
star
25

tiny-bench

A tiny benchmarking library
Rust
59
star
26

k8s-buildkite-plugin

Run any buildkite build step as a Kubernetes Job
Jsonnet
49
star
27

krates

๐Ÿ“ฆ Creates graphs of crates from cargo metadata ๐Ÿฆ€
Rust
45
star
28

opensource

Open source processes, policies, and info
Rust
42
star
29

cervo

Utility wrappers for tract
Rust
40
star
30

tracing-logfmt

A logfmt formatter for tracing subscriber logs
Rust
38
star
31

tame-gcs

๐Ÿ“‚ A small library with a limited set of Google Cloud Storage operations ๐Ÿฆ€
Rust
37
star
32

octobors

Rust program for automerging PRs based on a few rules
Rust
35
star
33

server-framework

Framework for running network services, opinions included
Rust
35
star
34

nfd2

OS native dialogs for Windows, MacOS, and Linux
Rust
32
star
35

cfg-expr

A parser and evaluator for Rust cfg() expressions. Targets as of Rust 1.58.0 are supported.
Rust
32
star
36

pdm-plugin-torch

A tool for managing torch-variants with PDM.
Python
31
star
37

opa-policies

Contains OPA Policies for Dockerfiles, Kubernetes YAMLs, Terraform, etc
Open Policy Agent
29
star
38

gsutil

Minimal gsutil replacement
Rust
27
star
39

spdx

๐Ÿ†” Helper crate for SPDX expressions. ๐Ÿฆ€
Rust
27
star
40

tame-index

Small crate for interacting with cargo registry indices
Rust
23
star
41

fsr-rs

Rust bindings for AMD FidelityFXโ„ข Super Resolution
C
22
star
42

opensource-website

๐ŸŒ Hub for Embark's open source efforts
HTML
22
star
43

buildkite-jobify

๐Ÿ‘ท Kubekite, but in Rust, using configuration from your repos ๐Ÿฆ€
Rust
21
star
44

spirv-tools-rs

๐Ÿ›  Wrapper crate for SPIRV-Tools ๐Ÿฆ€
C++
20
star
45

emote

Reinforcement learning library from Embark Studios
Python
19
star
46

proto-gen

A protobuf generation runner/cli using tonic build
Rust
18
star
47

rymder

Unofficial agones client SDK
Rust
17
star
48

sentry-contrib-rust

Integrates crashdump reporting with Sentry
Rust
15
star
49

tame-oidc

๐Ÿงฌ Small OAuth crate that follows the sans-io approach ๐Ÿฆ€
Rust
11
star
50

tame-webpurify

๐Ÿ’ฉ Small HTTP client for the Webpurify API following the sans-io approach ๐Ÿฆ€
Rust
9
star
51

cloud-dns

A wrapper for the Google Cloud DNS API (https://cloud.google.com/dns)
Rust
7
star
52

boh

Rust
5
star
53

tracing-ext-ffi-subscriber

Simple subscriber for forwarding tracing spans to a C or C++ profiling API.
Rust
4
star
54

server-code-exciser

A program that contains grammars and functionality to remove server only code from code bases.
C#
4
star
55

gke-accelerated-xorg-example

Example project for running remote rendering on GKE
Dockerfile
3
star
56

helix-oidc

๐Ÿงฌ Helix Perforce OIDC validator
Go
3
star
57

cassini

Topology-aware distributed cache
Go
2
star
58

minwin

Rust
2
star
59

container-packer-qemu

๐Ÿ“ฆ Dockerized packer with qemu
Dockerfile
1
star
60

rustc-compile-time-regress

Rust
1
star
61

missing-symbols

Rust
1
star
62

.github

Default community health files for GitHub (https://help.github.com/en/github/building-a-strong-community/creating-a-default-community-health-file-for-your-organization)
1
star
63

toml-span

Span preserving toml deserializer
Rust
1
star