I read about Async and Await Keywords in C# 5.0, which allows parallel tasks to be executed at the same time. (this is what i understood).
Is this practice useful for web applications?
Here, we have AJAX methods which allows tasks to be executed without blocking the UI (the browser).
Should they be used only for asynchronous web services?
Can you give me an example of why/howto use async/await keywords in a web applications? (to take advantage of this features)
Perhaps the best example i can think of is calling a series of web service methods from your Asynchronous Action method. For example:
Lets say you have two methods defined in your web service, Method1 and Method2. If each method takes 1 second, calling both of them synchronously would take 2 seconds, however calling them in a
asyncfashion would take less time.From MSDN:
Link: http://msdn.microsoft.com/en-us/library/ee728598(v=VS.98).aspx