@CompileStatic
class Dataflows
extends Object
A dynamic map of DataflowVariable instances, providing a concise syntax for dataflow-style programming.
Property reads block until the variable is bound; property writes bind the variable. Variables are created on demand.
def df = new Dataflows()
async { df.z = df.x + df.y
async { df.x = 10 }
async { df.y = 5 }
println "Result: ${df.z}" // 15
}
Inspired by GPars' Dataflows class.
| Constructor and description |
|---|
Dataflows() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
DataflowVariable |
getVariable(String name)Returns the underlying DataflowVariable for the given name without blocking. |
|
boolean |
isBound(String name)Returns true if the named variable has been bound. |
|
Object |
propertyMissing(String name)Reading a property awaits the corresponding DataflowVariable's value. |
|
void |
propertyMissing(String name, Object value)Writing a property binds the corresponding DataflowVariable. |
Returns the underlying DataflowVariable for the given name
without blocking. Useful for passing the variable itself
(e.g., to await or Awaitable.all).
name - the variable name Returns true if the named variable has been bound.
Reading a property awaits the corresponding DataflowVariable's value. Creates the variable on demand if it doesn't exist yet.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.