Executor

  • An executor is the executive body of a pipeline step

  • The pipeline defines the type of implementation of the executor

Definition of the delete_pipeline_data step 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 gets contained in the function process

  • Only the \TechDivision\ProcessPipelines\Api\ExecutorInterface has to get implemented

  • The stored type of the executor (XML) gets passed to the message queue with the argument list

  • The message queue forwards the classified messages with the info to the PipelineRunner (Consumer), which selects and executes the executor’s implementation based on the provided information

  • See PipelineRunners

Executor implementation TechDivision\ProcessPipelines\Model\Executor\CompressExecutor
<?php

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);
    }
}

Abstract executor classes

Classname Description

AbstractExecutor

  • The AbstractExecutor provides implementations for function getters and for deleting logs

AbstractArchiveExecutor

  • The AbstractArchiveExecutor gets copied from the AbstractExecutor and provides

    • Additional functions for file comparison

AbstractShellExecutor

  • The AbstractShellExecutor gets copied from the AbstractExecutor and provides

    • Additional functions to execute commands on the CLI level

Implemented executor models

Classname Description

DropCache

  • DropCache is a standard implementation to flush Magento caches with pipelines

  • DropCache uses the AbstractShellExecutor

  • In the process function, the command bin/magento cache:flush <CACHES> gets executed

  • The executor gets used in the Pacemaker Import Pipelines component

Reindex

  • The Reindex is a standard implementation to regenerate Magento indexes with pipelines

    • It uses the AbstractShellExecutor for this purpose

    • In the process function, the command bin/magento indexer:reindex <INDEXER> is executed

    • The executor gets used in the Pacemaker Import Pipelines component

CompressPipelineExecutor

  • 1. Step: The CompressPipelineExecutor is a standard implementation used in the component and the CleanUp pipeline

    • The executor compresses / archives the files of a pipeline by using the AbstractArchiveExecutor

DeleteExecutor

  • 2. Step: The DeleteExecutor is a standard implementation used in the component itself and the CleanUp pipeline

    • The executor deletes the files of a pipeline by using the AbstractArchiveExecutor

DeletePipelineExecutor

  • 3. Step: The DeletePipelineExecutor is a standard implementation used in the component and the CleanUp pipeline

    • The executor deletes the pipeline entries from the database using the AbstractArchiveExecutor