class WorkerPrev
Worker is a fundamental process that reads an inputObject, processes it and then writes the processed object to the next process in the process network. A Worker process may have a local workerClass instance of type workerClassName that stores intermediate results.
* The process has two parameters that govern its operation; outData and barrier
On termination of the process no specific action is taken. The process in which the Worker process occurs will take responsibility for subsequent transmission of the UniversalTerminator object.
Methods required by inputObject:
function( [dataModifier, wc] ) where wc is the local, possibly null, worker class instance
Methods required by workerClass, if present:
initClass(workerInitData)
finalise(finaliseData)
Behaviour: workerClass.initClass(workerInitData) while (running) { o = input.read() o.function([dataModifer, workerClass]) output.write(o) }
input The
- channel from which the input object to be processed is readoutput The
- channel to which the processed object is writtenfunction The
- name of the method corresponding to the method in the data object that is to be employeddataModifier A
- list of any values to be used by the function method; it is polymorphic in type
and defaults to nullworkerClassName
- The name of the class which is associated with the worker and
which maintains worker based data; defaults to null. The data held in the
worker class object will be lost when the process terminates.workerInit
- The name of the method corresponding to the method in workerClassname that implements worker class initialisation.workerInitData
- A list of any data required to initialise an instance of the workerClass; it is
polymorphic in type; defaults to null.workerFinalise
- The name of the method corresponding to the method in workerClassname that implements worker class finalise.finaliseData
- A list of any data required to undertake the finalise method of the workerClass; it is
polymorphic in type; defaults to null.outData
- If true the process will output each processed input object. If false the process will output
the workerClass once only, after it has processed all the input data objects. The output
only happens after the finalise method has been called. outData defaults to true.barrier
- If not null the worker process will synchronise on a Barrier with other Worker processes in the same Group;
barrier defaults to null, in which case no synchronisation between other Workers will take place.Type | Name and description |
---|---|
Barrier |
barrier |
List |
dataModifier |
List |
finaliseData |
String |
function |
ChannelInput |
input |
boolean |
outData |
ChannelOutput |
output |
String |
workerClassName |
String |
workerFinalise |
String |
workerInit |
List |
workerInitData |
Constructor and description |
---|
WorkerPrev
() |
GPP - Groovy Parallel Patterns generated test by Jon Kerridge, Edinburgh Napier University - j dot kerridge at napier dot ac dot uk