Skip to content

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

{
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