C
Carl Johansen
I'm not sure of the best way to do what I want. Users of my website want to
run reports that take a long time to generate. This is what I would like to
happen:
1. User requests aspx page
2. aspx page kicks off an asynchronous background task (on the same web
server) to generate the report. The end result will be a file created on
the website.
3. aspx page returns this message to the user: "your report is being
generated, check back in a few minutes"
4. aspx page ends.
5. (optional, the icing on the cake) A frame in the user's frameset starts
(through client-side script) sending periodic requests to the server to
check whether the report is ready, and displays a message box to inform the
user when they can pick it up.
6. User goes to their "My Reports" page and collects the report
7. After 24 hours the report file is automatically deleted from the server
Now, my question is how to do step 2. I guess it could be done with MSMQ,
but is there a better way? I tried making a Windows service and making an
asynchronous call to it with Delegate.BeginInvoke(). However, it doesn't
seem suited to my situation because it seems to insist that the caller (the
aspx page) stays alive for the end result, whereas I want the caller to
terminate while the callee is still running. When my BeginInvoke() caller
terminates, the callee seems to stop also. Additionally, the documentation
says the caller must call EndInvoke(), which mine can't.
Am I on the right track, or should I be using MSMQ? Shelling? A web
service? Some kind of ThreadPool? So many technologies...
Thanks in advance,
Carl Johansen
http://www.carljohansen.co.uk
run reports that take a long time to generate. This is what I would like to
happen:
1. User requests aspx page
2. aspx page kicks off an asynchronous background task (on the same web
server) to generate the report. The end result will be a file created on
the website.
3. aspx page returns this message to the user: "your report is being
generated, check back in a few minutes"
4. aspx page ends.
5. (optional, the icing on the cake) A frame in the user's frameset starts
(through client-side script) sending periodic requests to the server to
check whether the report is ready, and displays a message box to inform the
user when they can pick it up.
6. User goes to their "My Reports" page and collects the report
7. After 24 hours the report file is automatically deleted from the server
Now, my question is how to do step 2. I guess it could be done with MSMQ,
but is there a better way? I tried making a Windows service and making an
asynchronous call to it with Delegate.BeginInvoke(). However, it doesn't
seem suited to my situation because it seems to insist that the caller (the
aspx page) stays alive for the end result, whereas I want the caller to
terminate while the callee is still running. When my BeginInvoke() caller
terminates, the callee seems to stop also. Additionally, the documentation
says the caller must call EndInvoke(), which mine can't.
Am I on the right track, or should I be using MSMQ? Shelling? A web
service? Some kind of ThreadPool? So many technologies...
Thanks in advance,
Carl Johansen
http://www.carljohansen.co.uk