Background threads and maintenance applications - how to terminate them safely?
Background threads and maintenance applications - how to terminate them safely?
- Subject: Background threads and maintenance applications - how to terminate them safely?
- From: Miguel Arroz <email@hidden>
- Date: Tue, 23 Oct 2007 00:30:49 +0100
Hi!
Sorry for the long subject.
My problem is: I have two types of situations that worry me:
1) A maintenance app that is running on the server, with no user
interaction. It just seats there, in an infinite loop, doing stuff
that need to be done.
2) A normal app that sometimes launches a background thread to
process some stuff. The ideia is that the user submits data, but the
data processing may take some time (30 seconds, for example). What I
want is to send the "OK, great, it's done" page to the user,
terminate the session, and process his data in the background before
saving it.
My question is: how can I terminate this apps safely? When we are
talking about sessions, we have the "Refuse new sessions" option,
that will hold the app until no more active sessions exist. This will
terminate apps safely, without discarding data. How to do this with
background threads? How can I tell WO "do not terminate the app until
this thread is over or this method is done"?
Yours
Miguel Arroz
Miguel Arroz
http://www.terminalapp.net
http://www.ipragma.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden