ajax - Progress notifications from HTTP/REST service -


I am working on a web application that presents work to a master / worker system which can be used for any worker examples The series work queue master runs as a separate process (completely on a separate machine) and the tasks are presented through HTTP / REST requests. After the job is submitted to the queue, the client can submit another HTTP request to obtain status information about the application task.

For my web application, I want to give it some kind of progress bar view which gives the user some indication that how much work has come with the processing. The obvious way of implementing this would be an AJAX Progress Meter widget that periodically voted in the working queue for the position on the tasks presented. My question is, is it a better way to complete it without continuous voting?

I have considered opening client sockets to client web applications, on which the task master can listen for notifications. I had another common idea to use XMPP or a similar protocol for positioning information. (Of course, the Master / Worker system will need to update to provide information in some way, but for this I am the owner of the code so that any necessary updates can be done.)

Any ideas on the best ways such a notification system? Is extra effort worth it, or what goes the way of simple voting solutions?

I think it depends on some factors

  • Feedback How accurate can be (1%, 5%, 50%)
    Accurate response: Push some kind of progress bar and comet style. If you are only "busy ... hold ... almost ... ... done ...", then a simple Ajax "we are still" voting is probably easier for code.
  • Message should be viewed by the customer
  • How long each task takes (1 second, 10 seconds, 10 minutes)
    1 second makes it a bit profitable 10 It makes it worth 10 minutes, that means you better suggest that the user goes for a coffee break: -)
  • how many concurrent requests will be there
    Unless you have a "special" Servers, live push styles, system connections to eat and you get too much water Throwing more webservers for the fancy progress bar can be damaged by the budget will be maxed out.

I've got some sample code, which shows the hand rolled, which "works well", the project I developed was not in all the hard work However, although operations take a few seconds and we can give a very accurate percentage. Code uses asp.net and jquery, but general technology will work with any server and javascript framework.

Edit As you can say, position reporting is probably not the work of lush service but there is nothing that says that you can not open the iframe on the customer who Hooks on a page on the server for the selection on the service. The principle says that server and service will be at least close to one another: -)


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -