public class RunnableConsumer extends Object implements Runnable
PoisonRunnable
and an ExecutorService
to implement a
consumer / produce model. It will consume runnables from a queue and
immediately call its run method. Termination occurs when a
PoisonRunnable
is encountered, after it's run method is called.Constructor and Description |
---|
RunnableConsumer(BlockingQueue<Runnable> jobQueue)
Creates a new runnable that will consume and run other runnables.
|
public RunnableConsumer(BlockingQueue<Runnable> jobQueue)
jobQueue
- the queue from which to obtain runnable objects.Copyright © 2017. All rights reserved.