groovyx.gpars.dataflow.operator
Class PoisonTrackCounter
java.lang.Object
groovyx.gpars.dataflow.operator.PoisonTrackCounter
final class PoisonTrackCounter
- extends java.lang.Object
A helper class used by poison messages to count terminated dataflow processors
- Author:
- Vaclav Pech
Method Summary |
(package private) void |
countDown()
|
Promise<java.lang.Boolean> |
getTermination()
|
void |
join()
Blocks until the number of terminated operators reaches the number specified in the constructor |
void |
join(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until the number of terminated operators reaches the number specified in the constructor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
termination
private final DataflowVariable<java.lang.Boolean> termination
counter
private final java.util.concurrent.atomic.AtomicInteger counter
PoisonTrackCounter
PoisonTrackCounter(int count)
join
public void join()
throws java.lang.InterruptedException
- Blocks until the number of terminated operators reaches the number specified in the constructor
- Throws:
java.lang.InterruptedException
- If the current thread gets interrupted during the blocking
join
public void join(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
- Blocks until the number of terminated operators reaches the number specified in the constructor
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of the timeout
argument
- Throws:
java.lang.InterruptedException
- If the current thread gets interrupted during the blocking
getTermination
public Promise<java.lang.Boolean> getTermination()
countDown
void countDown()