473,385 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

aspx page to kick off async background task and then end

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


Nov 19 '05 #1
3 2099
This seems a nice article I found on the subject :
http://www.codeproject.com/aspnet/as...ionhandler.asp

I found it after googling
http://www.google.com/search?hl=en&l...ng&btnG=Search

Let me know if you have any more questions..

Cheers,
Tom Pester
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.u

Nov 19 '05 #2
Carl,

I don't know much about MSMQ, but I can put my 2c in your Windows service
cashbox.

A Windows service seems to be an appropriate solution in your case. As you
write, all you need to do is to kick a task off. But you are doing it in a
complicated way. There is a much simpler way.

Every time when the user requests a report, make a text file with the
request parameters in a preset location. Equip the windows service with a
FileSystemWatcher object that will notify the service about new request
files. Just in case make the service to poll the request directory
periodically to pickup missed notifications.

When the service is done with a report, it can send a notification email to
the user. If you wish, you can attach the report to the email.

Eliyahu

"Carl Johansen" <carl@_NOSPAM_carljohansen.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 19 '05 #3
Tom,

Thanks a lot; the article's idea of creating a custom thread is looking
promising.

Carl.
<To********************@pandora.be> wrote in message
news:a1**************************@news.microsoft.c om...
This seems a nice article I found on the subject :
http://www.codeproject.com/aspnet/as...ionhandler.asp

I found it after googling
http://www.google.com/search?hl=en&l...ng&btnG=Search

Let me know if you have any more questions..

Cheers,
Tom Pester
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


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Carl Johansen | last post by:
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....
2
by: Drew Stoddard | last post by:
We are working in C#/Winforms and are using asynchronous client-side web service calls (the Begin... and End... methods supplied by the web reference creation). Many of these calls are contained...
6
by: Sean C. | last post by:
Helpful folks, I am having a hard time figuring out how to reduce my percentage of dirty page steal activity. Below are statistics for three fairly normal days, with the bufferpool hit ratios...
1
by: milesm | last post by:
I've spent the last 3 hours reading various MSDN articles, other site articles and news group postings and was wondering what the best approach to my situation would be since I'm unable to come up...
4
by: Jeremy Holt | last post by:
Hi, In a windows.forms application I would BeginInvoke a delegate on the UI thread to collect data from a database. When the call returns to the AsyncCallback, if the Control.InvokeRequired =...
6
by: Shak | last post by:
Hi all, Three questions really: 1) The async call to the networkstream's endread() (or even endxxx() in general) blocks. Async calls are made on the threadpool - aren't we advised not to...
1
by: 1388-2/HB | last post by:
I have a class file in my App_Code folder called "clsBasePage.vb" that looks like this: Public Class clsBasePage Inherits System.Web.UI.Page ...stuff... End Class It's a "page" in that it...
10
by: Frankie | last post by:
It appears that System.Random would provide an acceptable means through which to generate a unique value used to identify multiple/concurrent asynchronous tasks. The usage of the value under...
2
by: thuythu | last post by:
Please help me.... I used and Javascript to view the data. But when i click button open a popup windows, then select data and click save button. The popup close and return the main page, but the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.