Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a service in the background

Status
Not open for further replies.

msjfc615

Programmer
Feb 26, 2004
13
US
My question is this I have a page that scrapes another page and this sometimes takes awhile. I want to send an email once this task is finished to let the user know that it has been finished and also to promote the service. However if they close the window the email will not send. So how would I run this in the background so that when the file shows then the email will be sent to the user. Any help would be greatly appreciated.
 
The problem is that if the user closes the window, the script stops running. Not only is the email not being sent, but the data-gathering is probably not completing, either.

Typically what you wan to do with this is have the user-side of the app add an entry to a queue somewhere. You could append an entry to a file or to a database.

Then you have a second script that is scheduled to run periodically. That script checks the queue, removes the entry at the top of the list, processes it, and emails information as necessary.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
The problem is that if the user closes the window, the script stops running. Not only is the email not being sent, but the data-gathering is probably not completing, either.

Typically what you wan to do with this is have the user-side of the app add an entry to a queue somewhere. You could append an entry to a file or to a database.

Then you have a second script that is scheduled to run periodically. That script checks the queue, removes the entry at the top of the list, processes it, and emails information as necessary.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Screen-scraping thoughts:

1. Usually people scrape content they don't own. A thought to copyright, fair use etc. should be given.
2. If you own the content then there are better ways to access it than screen scraping.
3. If you have an agreement with the content provider suggest or write an application to deliver the information in a more readily processable form (RSS, XML etc.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top