How do I implement long polling in MVC3 jquery application

I want to send a request to the server side from asp.net jquery html client side application.

the server side code will execute the task and once it completes, it will output some jpeg files.

the problem is that i want to automatically notify the web application when the jpegs are ready.

i am sending a call to the service every 2 seconds and it's polling way too much.

i want to somehow send a call to the server and then i want to get the response when the jpegs are in the directory.

i am using c# asp.net v4

Answers


SignalR is a fantastic client-server communication library that does all of the backwards-compatibility heavy lifting for you.


you can use Async Controller for such purpose. Please see this link for details Async controllers usage


Need Your Help

Schedule a local notification for a specific time in Swift 2

xcode notifications uilocalnotification swift2

I've been all over these forums and other sites and I keep getting pieces of an answer that don't add up. Essentially, I would like to create a notification that fires, for example, every weekday a...

Is there a way to map an URL to another URL in Spring?

java spring web-applications configuration

In Struts 1 you could have, in struts-config.xml, a declaration like: