class ThreePhaseWorker
ThreePhaseWorker is a specialisation of worker processes that incorporates three distinct phases into the process.
Phase 1 reads objects from the input channel which are then stored in a local worker object specified in the LocalDetails lDetails object. The data is passed as a parameter of the worker objects inFunction. This phase only terminates when a UniversalTerminator object is read.
Phase 2 runs the worker method, workFunction, which processes the input data now stored in the local worker object.
Phase 3 causes the output of the processed local worker object data to the output channel using the function outFunction. The outFunction returns an object which may be a different object to that which was read in. This phase terminates once all the local worker object has been output. The process then outputs the UniversalTerminator that was previoulsy read.
Methods required by the required local worker class specified in lDetails:
initClass(workerInitData)
finalise(finaliseData)
inFunction([dataModifer, o]) where o is the input object read from input channel
workFunction()
outFunction()
input The
- channel from which the input object to be processed is readoutput The
- channel to which the processed object is writteninFunction The
- name of the method corresponding to the method in the worker object that is to be employed to do the input operationworkFunction The
- name of the method corresponding to the method in the worker object that is to be employed to do the internal work operationoutFunction The
- name of the method corresponding to the method in the worker object that is to be employed to do the output operationdataModifier A
- list of any values to be used by the inFunction method; it is polymorphic in type
and defaults to nulllDetails
- A LocalDetails object containing data pertaining to any local class used by the worker, defaults to null.logPhaseName
- an optional string property, which if specified indicates that the process should be logged
otherwise the process will not be loggedlogPropertyName
- the name of a property in the input object that will uniquely identify an instance of the object.
LogPropertyName must be specified if logPhaseName is specifiedType | Name and description |
---|---|
List |
dataModifier |
String |
inFunction |
ChannelInput |
input |
LocalDetails |
lDetails |
String |
logPhaseName |
String |
logPropertyName |
String |
outFunction |
ChannelOutput |
output |
String |
workFunction |
Constructor and description |
---|
ThreePhaseWorker
() |
GPP - Groovy Parallel Patterns generated 06112016 by Jon Kerridge, Edinburgh Napier University - j.kerridge@napier.ac.uk