-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pick a more appropriate name for with_error_fn
?
#11
Comments
Sorry for the late response. This idea is quick and cool. How about let content = fetch
.retry(ExponentialBackoff::default())
.when(|e| e.to_string() == "EOF") // If error is retryable, retry it.
.await?; |
More concise! Can I help with this change? |
Of course! Welcome, go for this! Although |
Good advice, thanks! |
@Xuanwo This crate is awesome! I never thought of a retry mechanism that could be implemented in such an elegant way. 👍
However the function name
with_error_fn
is somewhat ambiguous for me. I cannot guess what it is used for without reading the comments.How about renaming it to
continue_if
orbreak_if
(on the contrary), following the naming convention instd::ops::ControlFlow
:v.s.
Personally I think
break_if
is a good choice. What do you think of it?The text was updated successfully, but these errors were encountered: