V - Type of the wrapped valuepublic class SyncValue<V>
extends java.lang.Object
| Constructor and Description |
|---|
SyncValue() |
| Modifier and Type | Method and Description |
|---|---|
V |
get()
Get the value.
|
boolean |
isAssigned()
Check if a value has been assigned.
|
void |
push(V value)
Provide any value for the consumer(s).
|
public void push(V value)
value - Value to publish. Any value is accepted.get()public V get()
push(Object) or the underlying
latch is interrupted. There is no timeout involved making this method potentially hazardous if value is never
provided.push(Object)HaltedException - Thrown if value cannot be acquired.public boolean isAssigned()