C# web scaffolding has an async call for every member. Why?
For example: Async for a login call makes no sense. User has to wait for validation. What else would the app do until the application validated the user.
Thoughts?
Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.
Sign up to join this communityC# web scaffolding has an async call for every member. Why?
For example: Async for a login call makes no sense. User has to wait for validation. What else would the app do until the application validated the user.
Thoughts?
The purpose of async
is not to return a value immediately; it is to allow your code to work on something else while your method await
s a return value.
async
doesn't magically make your method run faster. It still has to compute a result. What async
does do is make your code non-blocking on the server, and it can often do it without spinning up additional threads, because it merely reorders your code while respecting the order of return values.
To find out more about how this process works, read this MSDN article.
async
, by its wait for this value
nature impose, when working with interfaces, an animation or message about the fact that it's working? I found that designing around it often makes me think a lot more about my interface than I should. Is this an innate thing to async
or a byproduct of good standards?
– coolpasta
May 29 '19 at 1:12
Task<T>
interface that async
works with has a Status
member that includes IsCanceled
, IsCompleted
and IsFaulted
properties.
– Robert Harvey
May 29 '19 at 2:30