T
- Type of values to bind with the DataflowVariablepublic class DataflowVariable<T> extends DataflowExpression<T> implements DataflowChannel<T>, Promise<T>
Modifier and Type | Class and Description |
---|---|
static class |
DataflowVariable.RemoteDataflowVariable<T> |
DataflowExpression.BindDataflow<T>
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
error, S_INITIALIZED, S_INITIALIZING, S_NOT_INITIALIZED, state, value
serialHandle
Constructor and Description |
---|
DataflowVariable()
Creates a new unbound Dataflow Variable
|
Modifier and Type | Method and Description |
---|---|
private DataflowWriteChannel<T> |
bindDFV(DataflowReadChannel<T> ref) |
T |
get()
Retrieves the value of the variable, blocking until a value is available
|
T |
get(long timeout,
java.util.concurrent.TimeUnit units)
Retrieves the value of the variable, blocking up to given timeout, if the value has not been assigned yet.
|
java.lang.Throwable |
getError()
Returns the error bound to the promise
|
java.lang.Class<DataflowVariable.RemoteDataflowVariable> |
getRemoteClass()
Class of remote object to be created
|
boolean |
isError()
Checks if the promise is bound to an error
|
DataflowWriteChannel<T> |
leftShift(DataflowReadChannel<T> ref)
Assigns a value from one DataflowVariable instance to this variable.
|
DataflowWriteChannel<T> |
leftShift(T value)
Assigns a value to the variable.
|
(package private) boolean |
shouldThrowTimeout() |
<V> Promise<V> |
then(groovy.lang.Closure<V> closure,
groovy.lang.Closure<V> errorHandler)
Schedule closure to be executed after data became available.
|
<V> Promise<V> |
then(PGroup group,
groovy.lang.Closure<V> closure,
groovy.lang.Closure<V> errorHandler)
Schedule closure to be executed after data becomes available.
|
<V> Promise<V> |
then(Pool pool,
groovy.lang.Closure<V> closure,
groovy.lang.Closure<V> errorHandler)
Schedule closure to be executed after data becomes available.
|
void |
touch()
May be used by lazy implementations to warm up
|
binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, bind, bindError, bindSafely, bindUnique, chainWith, chainWith, chainWith, chainWith, chainWith, chainWith, choice, choice, choice, choice, choice, choice, doBindImpl, doBindRemote, evaluate, filter, filter, filter, filter, filter, filter, getBindErrorManager, getEventManager, getMetaClass, getProperty, getVal, getVal, getValAsync, getValAsync, into, into, into, into, into, into, invokeMethod, isBound, join, join, length, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, or, or, poll, rightShift, scheduleCallback, separate, separate, separate, separate, separate, separate, setMetaClass, setProperty, split, split, split, split, split, split, split, split, split, split, split, split, subscribe, subscribe, tap, tap, tap, tap, tap, tap, then, then, then, thenForkAndJoin, thenForkAndJoin, thenForkAndJoin, toString, transform, whenBound, whenBound, whenBound, whenBound, wheneverBound, wheneverBound
createRemoteHandle, getOrCreateSerialHandle, writeReplace
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, binaryChoice, chainWith, chainWith, chainWith, chainWith, chainWith, chainWith, choice, choice, choice, choice, choice, choice, filter, filter, filter, filter, filter, filter, getEventManager, getVal, getVal, getValAsync, getValAsync, into, into, into, into, into, into, isBound, length, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, merge, or, or, rightShift, separate, separate, separate, separate, separate, separate, split, split, split, split, split, split, split, split, split, split, split, split, tap, tap, tap, tap, tap, tap, then, then, then, whenBound, whenBound, whenBound, whenBound
poll, wheneverBound, wheneverBound
bind
isBound, join, join, rightShift, then, then, then, thenForkAndJoin, thenForkAndJoin, thenForkAndJoin, whenBound, whenBound, whenBound, whenBound
private static final long serialVersionUID
public DataflowVariable()
public DataflowWriteChannel<T> leftShift(T value)
leftShift
in interface DataflowWriteChannel<T>
value
- The value to assignpublic DataflowWriteChannel<T> leftShift(DataflowReadChannel<T> ref)
leftShift
in interface DataflowWriteChannel<T>
ref
- The DataflowVariable instance the value of which to bindprivate DataflowWriteChannel<T> bindDFV(DataflowReadChannel<T> ref)
public final T get() throws java.lang.Throwable
public final T get(long timeout, java.util.concurrent.TimeUnit units) throws java.lang.Throwable
boolean shouldThrowTimeout()
public boolean isError()
public java.lang.Throwable getError()
public void touch()
Promise
public <V> Promise<V> then(groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler)
then
in interface Promise<T>
closure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.public <V> Promise<V> then(Pool pool, groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler)
then
in interface Promise<T>
pool
- The thread pool to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.public <V> Promise<V> then(PGroup group, groovy.lang.Closure<V> closure, groovy.lang.Closure<V> errorHandler)
then
in interface Promise<T>
group
- The PGroup to use for task scheduling for asynchronous message deliveryclosure
- closure to execute when data becomes available. The closure should take at most one argument.errorHandler
- closure to execute when an error (instance of Throwable) gets bound. The closure should take at most one argument.public java.lang.Class<DataflowVariable.RemoteDataflowVariable> getRemoteClass()
WithSerialId
getRemoteClass
in class WithSerialId