Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add true synchronous GetResponse() method to WebServiceRequestBase #3

Open
NateMerritt opened this issue Oct 26, 2017 · 0 comments
Open

Comments

@NateMerritt
Copy link
Contributor

This commit removed WebServiceRequestBase.GetResponse(), which at the time was a sync-over-async antipattern:

		public TResponse GetResponse(CancellationToken cancellationToken = default(CancellationToken))
		{
			// wait for async, which supports timeout
			return GetResponseAsync(cancellationToken).GetAwaiter().GetResult();
		}

The conversation on that commit shows that if a synchronous GetReponse() method is needed then a true synchronous GetResponse() that does synchronous I/O (instead of blocking on an asynchronous call) is preferred. I'm currently writing an API client in which I would like to support synchronous web calls for legacy UI projects. If we port our former Libronix.Utility solution using HttpWebRequest here just for the synchronous GetResponse() then I can use this library, otherwise I'll have to use Libronix.Utility. HttpWebRequest has netstandard2.0 support.

bgrainger added a commit that referenced this issue Nov 7, 2017
 Don't delete cake directory when script changes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant