[concurrency-interest] Question / Feature Request for ExecutorService
joe.bowbeer at gmail.com
Wed Nov 16 17:05:00 EST 2011
With ThreadPoolExecutor, you have the API to accomplish this in a couple of
1: tpe.shutdown(); tpe.getQueue().drainTo(submitted);
The above is similar to what shutdownNow does.
2. Another way would be to wrap the tasks on submission with a Runnable
that checks isTerminating() and punts if it is true.
On Wed, Nov 16, 2011 at 1:31 PM, Morgan Conrad <morganconrad at yahoo.com>wrote:
> This question came up on StackOverflow.
> Basically, the request seems reasonable:
> "I want to call a command that:
> a. Completes the currently active task or tasks (like shutdown).
> b. Halts the processing of waiting tasks (like shutdownNow)."
> Is there a good way to do this using the existing code?
> Morgan Conrad
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest