-
Notifications
You must be signed in to change notification settings - Fork 618
Description
Is your feature request related to a problem? Please describe.
async/await is not SDK "magic faerie dust". Whilst it is important to support it, it is also important to support sync APIs.
If you do not support synchronous APIs you impose a design decision on all consumers of your SDK: you must use asynchronous i/o or you have to block on an asynchronous operation. The problem here is that blocking on an asynchronous operation is far worse of a problem, than using blocking i/o.
An async/await programming model is viral; it forces the whole program, from top-to-bottom to become async. This may or may not be a valid choice, but as an SDK owner, you cannot determine this
In addition, in some cases, blocking i/o may be a better option, so you should leave this open for clients.
I note that the ASP.NET team had to roll back their decision to provide only non-blocking APIs, for exactly the same problem space.
Generally, SDK writers should not make choices for their users, as they cannot know their context. Specifically, they should not choose their concurrency model in this case. You can be opinionated, and prefer some options over others, but always provide an escape route to allow your opinions to be avoided.
You don't have the context to decide if a consumer should use async/await.
Describe the solution you'd like
A #dotnet SDK should support both blocking and non-blocking operations, so as to not force design decisions on consumers of that SDK, or force dangerous behaviors such as blocking on async.
Please put the synchronous APIs back into the SDK, with immediate effect.
Describe alternatives you've considered
One alternative here is to fork the SDK, and to put synchronous approaches back into the SDK. This seems to be an unhelpful response, so it would be better to discuss why this SDK change should be reconsidered.
Additional context
It is great that there are now asynchronous APIs. But the support for asynchronous APIs should not come at the expense of imposing design decisions on consumers of your SDK.