I have an application that scans an input directory every five seconds and when a job (i.e. file) is placed in the directory the application reads it, processes it and outputs another file(s) in an output directory.
My question is, If I wanted to put a web based front end on this application, how would I wait for the processing to be complete?
- User submits job
- job is placed in input directory
- ......What am I doing on the web page here?
- processing occurs
- output file is generated
- ......How do I know that the job is finished?
The two solutions I came up with were:
- poll output directory every x seconds from the webpage
- use ajax to poll a webservice or webpage that reports back whether the output file is present
Is there a better design for the server? In other words, how would TCP or Named Pipes help in this situation? (Cannot use remoting due to a DCOM object.)