Executor
Step definition delete_pipeline_data
vendor/techdivision/process-pipelines/etc/pipeline.xml
<step name="delete_pipeline_data" executorType="TechDivision\ProcessPipelines\Model\Executor\DeleteExecutor" sortOrder="20" description="" >
…
</step>
The logic of an executor is located in the function process.
Thereby only the \TechDivision\ProcessPipelines\Api\ExecutorInterface
must be implemented.
Executor Implementation
TechDivision\ProcessPipelines\Model\Executor\CompressExecutor
public function process(StepInterface $step)
{
$compressTime = $this->getCompareTime(
ConfigInterface::CONFIG_PATH_CLEAN_UP_COMPRESS
);
$fileListToCompress = $this->getDirListOlderThenCompareTime($compressTime);
...
foreach ($fileListToCompress as $folderToCompress) {
if ($this->hasFiles($folderToCompress) === false) {
...
$this->delete($folderToCompress);
continue;
}
...
$this->archive($folderToCompress);
}
}
As already mentioned in the description of the PipelineRunner, the stored type of the executor (XML) is passed to the message queue queue via the argument list.
This forwards the queued messages with the information to the PipelineRunner (Consumer), which selects and executes the implementation of the Executor based on the information.