Skip to content

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Async Set Operations #20

wants to merge 12 commits into from

Conversation

NirAgai
Copy link
Contributor

@NirAgai NirAgai commented Jun 25, 2020

No description provided.

@amitla
Copy link
Collaborator

amitla commented Jul 6, 2020

@NirAgai
There are quite a few new public APIs that are not documented, please add documentation on all public APIs

@@ -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)
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants