Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inremediate page, while processing?  RSS feed

 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
my problem is...
When a user click on a button, request will sent to the server, there while processing, i have to send an intermediate page to the user saying that "your request is processing... please wait". Once the process completed, i need to disply the response to the user.
how can i do it?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How long does the order processing take?
 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Ben Souther,
We can not predict how it will long, because the process is like search for perticular user and saving that information in somewhere else and display the same information, so it all will depend on various elements.
thats why we can not predict how long it will be?
i hope it will help in aiding me.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an example app on my site that does just this.

It..
  • Receives the initial request
  • Spawns a new thread to handle the long running task
  • Returns a response immediately to the browser. The response page contains a meta refresh tag that will cause the page to refresh every n seconds.
  • With each request from the status page, it checks for a marker (in this case a session variable but something in a database would work too).
  • If the marker show incomplete, it returns the status page again.
  • Once the marker shows complete, it returns the results from the long running task


  • You can find the example code on:
    http://simple.souther.us/not-so-simple.html
    Look for LongRunningProcess
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!