Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: New Document (CGI)

From: cybarite:sympatico:ca at: 24-Apr-2002 11:57

Ammon, Not as pretty as you might want but you can use the html meta tag to refresh the page . browser sends request to CGI script ... say script is %long-running-thing.r . %long-running-thing.r sends page to browser with message about process in progress . this page includes <META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://your.domain/monitor.r"> . %long-running-thing.r script sets semaphore to indicate process not done . %long-running-thing.r starts its work . after 10 seconds, the browser refresh sends a request to your %monitor.r to see if anything has finished . %monitor.r checks the semaphore . if done, then %monitor. r sends the final results to the browser . if not done, then %monitor.r returns the same (or another) in progress message to the browser . this refreshed page has to have a meta tag in it to refresh as the original message did . long-running-thing.r runs in background . when finished, it stores the results where they can be picked up by monitor.r and sent to the browser . when finished, it resets the semaphore to indicate that the process is done . for the semaphores, it can be whatever you need but writing a file named with the unique key to distinguish separate users seems to work . you can pass the key back on the url for the refresh e.g. <META HTTP-EQUIV="Refresh" CONTENT="10;URL=http://your.domain/monitor.r?key=123456789"> And, of course, the semaphore file can be the result file if %long-running.thing.r is written that way.