Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are a couple of issues here:</p> <ul> <li>How to cause ASP.NET to start returning data as soon as each item is available,</li> <li>How to coordinate the client &amp; server, so that the client knows that a new item is available (i.e. so it can parse each item in the response separately, or so it can request more data if you're looking for 'pull')</li> </ul> <p>As explained in AlexK's answer, the <code>async</code> api does not alter the way the server responds to the client. Async only allows for your app to free-up threads when they're not in use, and makes it easier to parallelize portions of requests that depend on multiple resources.</p> <p>Besides using SignalR, which is designed for this, you can use the built-in lower-level mechanism - <a href="http://msdn.microsoft.com/en-us/library/system.net.http.pushstreamcontent%28v=vs.118%29.aspx" rel="nofollow">PushStreamContent</a> - yourself. Here are a couple of blog posts on how to do that:</p> <ul> <li><a href="http://blogs.msdn.com/b/henrikn/archive/2012/04/23/using-cookies-with-asp-net-web-api.aspx" rel="nofollow">Original announcement from the ASP.Net team</a> including some demo code - scroll down to "Push Content"</li> <li><a href="http://www.strathweb.com/2012/05/native-html5-push-notifications-with-asp-net-web-api-and-knockout-js/" rel="nofollow">Native HTML5 push notifications with ASP.NET Web API and Knockout.js</a>, includes example of <strong>the client side (in a browser)</strong>. Also related - <a href="http://www.strathweb.com/2013/01/asynchronously-streaming-video-with-asp-net-web-api/" rel="nofollow">Asynchronously streaming video with ASP.NET Web API</a></li> <li><a href="http://weblogs.asp.net/andresv/archive/2012/12/12/asynchronous-streaming-in-asp-net-webapi.aspx" rel="nofollow">Asynchronous Streaming in ASP.NET WebApi</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload