Angular JS supports Promise Defer functionality which is asynchronous. If I have async support on the client side, do I still need to expose async methods via WEB-API?
Asked
Active
Viewed 305 times
1
-
3Not necessarily. Client side and server-side aren't aware of the internal method implementation. Angular should expose a callback mechanism which is unrelated to how the method is invoked on the server-side. – Yuval Itzchakov Feb 02 '15 at 09:33
-
possible duplicate of [Web API async method with AngularJS](http://stackoverflow.com/questions/28238418/web-api-async-method-with-angularjs) – i3arnon Feb 02 '15 at 16:46
1 Answers
2
Making the client async improves the user experience, because user doesn't have to wait for every request.
But using async methods in the server can make the server faster and able to manage more requests. It is the same as in the client, if you don't block the main thread you are able to do other things while the other operation is executing.
You can implement async methods in one or in both sides. In each side you can get different benefits.
In this other question there are more information that explais when it is important to use async methods: Why should I create async WebAPI operations instead of sync ones?

Community
- 1
- 1

jvrdelafuente
- 1,992
- 14
- 23
-
It's not clear how this actually answers the question. Can you clarify? To me this just seems to be a statement of fact. – Daniel Kelley Feb 02 '15 at 10:53
-
I have added a link that explains a bit more why and when it is right to do async methods in web api. @DanielKelley – jvrdelafuente Feb 02 '15 at 11:03
-
Doesn't really help (me at least). The question is, if the client is async does the server have to be too. You seem to be answering the question is it beneficial to have an async server. – Daniel Kelley Feb 02 '15 at 11:11
-