-
Notifications
You must be signed in to change notification settings - Fork 8
Async Set Operations #20
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
base: master
Are you sure you want to change the base?
Conversation
Added async set operations.
Added null and empty values checks in set operations that receive an array of values.
Feature/async set operations
@NirAgai |
@@ -265,10 +266,18 @@ public static TResult Retry<TResult>(Func<TResult> func, int maxAttempts) | |||
{ | |||
return RetryUtil.Retry(func, maxAttempts); | |||
} | |||
public async static Task<TResult> RetryAsync<TResult>(Func<Task<TResult>> func, int maxAttempts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cases where you have methods that can only return the task without await
-ing it, please do. in this case, the method should look something like this:
public static Task<TResult> RetryAsync<TResult>(Func<Task<TResult>> func, int maxAttempts)
{
return RetryUtil.RetryAsync(func, maxAttempts);
}
the responsibility to await moves to the caller (keep in mind that the caller would have awaited the result anyway) this way you have one less async-await state machine in your result
No description provided.