Re: Background threads and maintenance applications - how to terminate them safely?
Re: Background threads and maintenance applications - how to terminate them safely?
- Subject: Re: Background threads and maintenance applications - how to terminate them safely?
- From: Lachlan Deck <email@hidden>
- Date: Tue, 23 Oct 2007 10:08:01 +1000
Hi there,
On 23/10/2007, at 9:30 AM, Miguel Arroz wrote:
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.
See below.
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.
WOLongResponse + NSNotificationCenter.
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"?
See WOApplication.terminate/isTerminating.
with regards,
--
Lachlan Deck
_______________________________________________
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