public class Consumer
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
Consumer(ConcurrentBufferedUpdate.CyclicTaskQueue taskQueue,
int no) |
Modifier and Type | Method and Description |
---|---|
int |
getId_no() |
void |
run()
Executes tasks or waits on a cyclic barrier until a poison task is
consumed which kills this consumer (sets
live to false). |
void |
shutdown() |
public Consumer(ConcurrentBufferedUpdate.CyclicTaskQueue taskQueue, int no)
barrier
- the cyclic barrier this consumer will wait attaskQueue
- the blocking queue this consumer will take tasks fromno
- an optional ID number parameter for the consumer, used mainly
for debugging, but can be used to call out an individual
consumer elsewhere.public void run()
live
to false).run
in interface java.lang.Runnable
public int getId_no()
public void shutdown()