1 | <?php |
||
25 | abstract class BaseSymfonyWorker extends BaseWorker |
||
26 | { |
||
27 | /** |
||
28 | * Symfony event dispatcher. |
||
29 | * |
||
30 | * @var EventDispatcherInterface |
||
31 | */ |
||
32 | private $eventDispatcher; |
||
33 | |||
34 | public function __construct(ProcessorFactoryInterface $processorFactory, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null) |
||
39 | |||
40 | /** |
||
41 | * Get subsystem name. |
||
42 | * |
||
43 | * This name may be used further to identify worker subsystem in logs or events. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | abstract public function getSubsystemName(); |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | protected function beforeTranslateHook(&$commandData) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | protected function afterProcessHook(CommandInterface $command, CommandProcessorInterface $processor) |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | protected function processorErrorHook(CommandInterface $command, CommandProcessorInterface $processor, Exception $e) |
||
78 | |||
79 | /** |
||
80 | * Clear logs. |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | private function clearLogs() |
||
98 | |||
99 | } |
||
100 |