Skip to content

Conversation

kendallb
Copy link
Contributor

Added back all missing Async API functions (except for json streaming via async not sure how to convert that one).

… via async not sure how to convert that one).
/// Executes the request synchronously, authenticating if needed
/// </summary>
/// <param name="request">Request to be executed</param>
public RestResponse Execute(RestRequest request) => AsyncHelpers.RunSync(() => ExecuteAsync(request));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need it here, or can it be an extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems simple enough to put it there, but it could be moved to RestClientExtensions I suppose? What would you prefer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is if it should be a part of the potentially returned IRestClient interface. Do you think it makes sense to keep non-async methods as the core functionality?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think they should be part of the core functionality and if there was an IRestClient interface, it should include the non-async functions as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be two interfaces, one for sync and one for non to keep it clean, but IRestClient should inherit both as many people will use both sync and async in their code.

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