|
org.codehaus.gpars | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovyx.gpars.dataflow.Dataflow
@java.lang.SuppressWarnings* public abstract class Dataflow
Contains factory methods to create dataflow actors and starting them.
Field Summary | |
---|---|
static PGroup |
DATA_FLOW_GROUP
|
static java.lang.ThreadLocal |
activeParallelGroup
|
Constructor Summary | |
Dataflow()
|
Method Summary | |
---|---|
static Promise
|
lazyTask(groovy.lang.Closure code)
Creates a new task assigned to a thread from the current parallel group. |
static Promise
|
lazyTask(java.util.concurrent.Callable callable)
Creates an operator using the default dataflow parallel group |
static DataflowProcessor
|
operator(java.util.Map channels, groovy.lang.Closure code)
Creates an operator using the current parallel group |
static DataflowProcessor
|
operator(java.util.List inputChannels, java.util.List outputChannels, groovy.lang.Closure code)
Creates an operator using the current parallel group |
static DataflowProcessor
|
operator(java.util.List inputChannels, java.util.List outputChannels, int maxForks, groovy.lang.Closure code)
Creates an operator using the current parallel group |
static DataflowProcessor
|
operator(DataflowReadChannel input, DataflowWriteChannel output, groovy.lang.Closure code)
Creates an operator using the current parallel group |
static DataflowProcessor
|
operator(DataflowReadChannel input, DataflowWriteChannel output, int maxForks, groovy.lang.Closure code)
Creates a selector using the default dataflow parallel group |
static DataflowProcessor
|
prioritySelector(java.util.Map channels, groovy.lang.Closure code)
Creates a prioritizing selector using the default dataflow parallel group Input with lower position index have higher priority. |
static DataflowProcessor
|
prioritySelector(java.util.List inputChannels, java.util.List outputChannels, groovy.lang.Closure code)
Creates a prioritizing selector using the default dataflow parallel group. |
static DataflowProcessor
|
prioritySelector(java.util.Map channels)
Creates a prioritizing selector using the default dataflow parallel group. |
static DataflowProcessor
|
prioritySelector(java.util.List inputChannels, java.util.List outputChannels)
Creates a splitter copying its single input channel into all of its output channels. |
static PGroup
|
retrieveCurrentDFPGroup()
|
static Select
|
select(SelectableChannel... channels)
Creates a select using the default dataflow parallel group. |
static Select
|
select(java.util.List channels)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static DataflowProcessor
|
selector(java.util.Map channels, groovy.lang.Closure code)
Creates a selector using the default dataflow parallel group |
static DataflowProcessor
|
selector(java.util.List inputChannels, java.util.List outputChannels, groovy.lang.Closure code)
Creates a selector using the default dataflow parallel group. |
static DataflowProcessor
|
selector(java.util.Map channels)
|
static DataflowProcessor
|
selector(java.util.List inputChannels, java.util.List outputChannels)
Creates a prioritizing selector using the default dataflow parallel group Input with lower position index have higher priority. |
static DataflowProcessor
|
splitter(DataflowReadChannel inputChannel, java.util.List outputChannels)
Creates a splitter copying its single input channel into all of its output channels. |
static DataflowProcessor
|
splitter(DataflowReadChannel inputChannel, java.util.List outputChannels, int maxForks)
Creates a select using the default dataflow parallel group. |
static Promise
|
task(groovy.lang.Closure code)
Creates a new task assigned to a thread from the current parallel group. |
static Promise
|
task(java.util.concurrent.Callable callable)
Creates a new task assigned to a thread from the current parallel group. |
static Promise
|
task(java.lang.Runnable runnable)
Creates a new task assigned to a thread from the default dataflow parallel group. |
static java.lang.Object
|
usingGroup(PGroup group, groovy.lang.Closure code)
|
static Promise
|
whenAllBound(java.util.List promises, groovy.lang.Closure code)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, groovy.lang.Closure code)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, Promise promise2, groovy.lang.Closure code)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, Promise promise2, Promise promise3, groovy.lang.Closure code)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, Promise promise2, Promise promise3, Promise promise4, groovy.lang.Closure code)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(java.util.List promises, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, Promise promise2, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
Without blocking the thread waits for all the promises to get bound and then passes them to the supplied closure. |
static Promise
|
whenAllBound(Promise promise1, Promise promise2, Promise promise3, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
|
static Promise
|
whenAllBound(Promise promise1, Promise promise2, Promise promise3, Promise promise4, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final PGroup DATA_FLOW_GROUP
public static final java.lang.ThreadLocal activeParallelGroup
Constructor Detail |
---|
Dataflow()
Method Detail |
---|
public static Promise lazyTask(groovy.lang.Closure code)
callable
- The task body to run
public static Promise lazyTask(java.util.concurrent.Callable callable)
channels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputscode
- The operator's body to run each time all inputs have a value to read
public static DataflowProcessor operator(java.util.Map channels, @groovy.lang.DelegatesTo groovy.lang.Closure code)
inputChannels
- dataflow channels to use for inputoutputChannels
- dataflow channels to use for outputcode
- The operator's body to run each time all inputs have a value to read
public static DataflowProcessor operator(java.util.List inputChannels, java.util.List outputChannels, @groovy.lang.DelegatesTo groovy.lang.Closure code)
inputChannels
- dataflow channels to use for inputoutputChannels
- dataflow channels to use for outputmaxForks
- Number of parallel threads running operator's body, defaults to 1code
- The operator's body to run each time all inputs have a value to read
public static DataflowProcessor operator(java.util.List inputChannels, java.util.List outputChannels, int maxForks, @groovy.lang.DelegatesTo groovy.lang.Closure code)
input
- a dataflow channel to use for inputoutput
- a dataflow channel to use for outputcode
- The operator's body to run each time all inputs have a value to read
public static DataflowProcessor operator(DataflowReadChannel input, DataflowWriteChannel output, @groovy.lang.DelegatesTo groovy.lang.Closure code)
input
- a dataflow channel to use for inputoutput
- a dataflow channel to use for outputmaxForks
- Number of parallel threads running operator's body, defaults to 1code
- The operator's body to run each time all inputs have a value to read
public static DataflowProcessor operator(DataflowReadChannel input, DataflowWriteChannel output, int maxForks, @groovy.lang.DelegatesTo groovy.lang.Closure code)
channels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputscode
- The selector's body to run each time a value is available in any of the inputs channels
public static DataflowProcessor prioritySelector(java.util.Map channels, @groovy.lang.DelegatesTo groovy.lang.Closure code)
inputChannels
- dataflow channels to use for inputoutputChannels
- dataflow channels to use for outputcode
- The selector's body to run each time a value is available in any of the inputs channels
public static DataflowProcessor prioritySelector(java.util.List inputChannels, java.util.List outputChannels, @groovy.lang.DelegatesTo groovy.lang.Closure code)
channels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputs
public static DataflowProcessor prioritySelector(java.util.Map channels)
inputChannels
- dataflow channels to use for inputoutputChannels
- dataflow channels to use for output
public static DataflowProcessor prioritySelector(java.util.List inputChannels, java.util.List outputChannels)
inputChannel
- The channel to read values fromoutputChannels
- A list of channels to output to
public static PGroup retrieveCurrentDFPGroup()
public static Select select(SelectableChannel... channels)
channels
- Dataflow variables or streams to wait for values on
public static Select select(java.util.List channels)
promises
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promises
- The type of the final result
public static DataflowProcessor selector(java.util.Map channels, @groovy.lang.DelegatesTo groovy.lang.Closure code)
inputChannels
- dataflow channels to use for inputoutputChannels
- dataflow channels to use for outputcode
- The selector's body to run each time a value is available in any of the inputs channels
public static DataflowProcessor selector(java.util.List inputChannels, java.util.List outputChannels, @groovy.lang.DelegatesToe selector will simply copy the incom groovy.lang.Closure code)
channels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputs
public static DataflowProcessor selector(java.util.Map channels)
public static DataflowProcessor selector(java.util.List inputChannels, java.util.List outputChannels)
channels
- A map specifying "inputs" and "outputs" - dataflow channels (instances of the DataflowQueue or DataflowVariable classes) to use for inputs and outputscode
- The selector's body to run each time a value is available in any of the inputs channels
public static DataflowProcessor splitter(DataflowReadChannel inputChannel, java.util.List outputChannels)
inputChannel
- The channel to read values fromoutputChannels
- A list of channels to output tomaxForks
- Number of threads running the splitter's body, defaults to 1
public static DataflowProcessor splitter(DataflowReadChannel inputChannel, java.util.List outputChannels, int maxForks)
channels
- Dataflow variables or streams to wait for values on
public static Promise task(groovy.lang.Closure code)
callable
- The task body to run
public static Promise task(java.util.concurrent.Callable callable)
runnable
- The task body to run
public static Promise task(java.lang.Runnable runnable)
code
- The task body to run
public static java.lang.Object usingGroup(PGroup group, groovy.lang.Closure code)
public static Promise whenAllBound(java.util.List promises, groovy.lang.Closure code)
promise1
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promises
- The type of the final result
public static Promise whenAllBound(Promise promise1, groovy.lang.Closure code)
promise1
- The promises to wait forpromise2
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promises
- The type of the final result
public static Promise whenAllBound(Promise promise1, Promise promise2, groovy.lang.Closure code)
promise1
- The promises to wait forpromise2
- The promises to wait forpromise3
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promises
- The type of the final result
public static Promise whenAllBound(Promise promise1, Promise promise2, Promise promise3, groovy.lang.Closure code)
promise1
- The promises to wait forpromise2
- The promises to wait forpromise3
- The promises to wait forpromise4
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promises
- The type of the final result
public static Promise whenAllBound(Promise promise1, Promise promise2, Promise promise3, Promise promise4, groovy.lang.Closure code)
promises
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promiseserrorHandler
- A closure handling an exception (an instance of Throwable), if it gets bound
- The type of the final result
public static Promise whenAllBound(java.util.List promises, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
promise1
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promiseserrorHandler
- A closure handling an exception (an instance of Throwable), if it gets bound
- The type of the final result
public static Promise whenAllBound(Promise promise1, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
promise1
- The promises to wait forpromise2
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promiseserrorHandler
- A closure handling an exception (an instance of Throwable), if it gets bound
- The type of the final result
public static Promise whenAllBound(Promise promise1, Promise promise2, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
promise1
- The promises to wait forpromise2
- The promises to wait forpromise3
- The promises to wait forcode
- A closure to execute with concrete values for each of the supplied promiseserrorHandler
- A closure handling an exception (an instance of Throwable), if it gets bound
- The type of the final result
public static Promise whenAllBound(Promise promise1, Promise promise2, Promise promise3, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
public static Promise whenAllBound(Promise promise1, Promise promise2, Promise promise3, Promise promise4, groovy.lang.Closure code, groovy.lang.Closure errorHandler)
Copyright © 2008–2013 Václav Pech. All Rights Reserved.