[concurrency-interest] cancelling future

Joe Bowbeer joe.bowbeer at gmail.com
Tue Feb 28 20:01:24 EST 2006


If you Future impl. can query isCancelled if that would help it be
more responsive to cancellation.  But that probably isn't your
question.

The most common method for cleaning up inside a Future after
cancellation is to override the done method (of FutureTask).  If
isCancelled is true here, then cancel the Futures that are dependent
on yours.

On 2/28/06, Christopher Kin Chung Au <cau at aspecthuntley.com.au> wrote:
>
> Currently I have an application which sends out bulk email we use the
> ExecutorService submit to get a future object back which we store. This
> future object holds many other future objects which are the actual workers
> that send out the email. The intention is that we will potentially have many
> bulk email future objects which in turn hold many email future objects
> sending out the emails. We want to be able to choose and cancel a designated
> bulk email future object which in turn stops all the email future objects
> associated with that bulk email future object while the other bulk email
> future objects remain intact. I have used the cancel command but whilst the
> bulk email future object reports that it has been cancelled the email future
> objects seem to continue to run. I hope this makes sense and any help would
> be appreciated.
>



More information about the Concurrency-interest mailing list