Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Commit

Permalink
remove not needed dependencies from _constructor and params for creat…
Browse files Browse the repository at this point in the history
…ion massConsumerEnvelopeCallback
  • Loading branch information
anvasiliev committed May 28, 2019
1 parent 331e311 commit dad12c6
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions app/code/Magento/AsynchronousOperations/Model/MassConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,11 @@ class MassConsumer implements ConsumerInterface
*/
private $invoker;

/**
* @var \Magento\Framework\App\ResourceConnection
*/
private $resource;

/**
* @var \Magento\Framework\MessageQueue\ConsumerConfigurationInterface
*/
private $configuration;

/**
* @var \Magento\Framework\MessageQueue\MessageController
*/
private $messageController;

/**
* @var LoggerInterface
*/
private $logger;

/**
* @var OperationProcessor
*/
private $operationProcessor;

/**
* @var Registry
*/
Expand All @@ -75,32 +55,18 @@ class MassConsumer implements ConsumerInterface
* Initialize dependencies.
*
* @param CallbackInvokerInterface $invoker
* @param ResourceConnection $resource
* @param MessageController $messageController
* @param ConsumerConfigurationInterface $configuration
* @param OperationProcessorFactory $operationProcessorFactory
* @param LoggerInterface $logger
* @param MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback
* @param Registry $registry
*/
public function __construct(
CallbackInvokerInterface $invoker,
ResourceConnection $resource,
MessageController $messageController,
ConsumerConfigurationInterface $configuration,
OperationProcessorFactory $operationProcessorFactory,
LoggerInterface $logger,
MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback,
Registry $registry = null
) {
$this->invoker = $invoker;
$this->resource = $resource;
$this->messageController = $messageController;
$this->configuration = $configuration;
$this->operationProcessor = $operationProcessorFactory->create([
'configuration' => $configuration
]);
$this->logger = $logger;
$this->massConsumerEnvelopeCallback = $massConsumerEnvelopeCallback;
$this->registry = $registry ?? \Magento\Framework\App\ObjectManager::getInstance()
->get(Registry::class);
Expand Down Expand Up @@ -133,12 +99,7 @@ public function process($maxNumberOfMessages = null)
private function getTransactionCallback(QueueInterface $queue)
{
$callbackInstance = $this->massConsumerEnvelopeCallback->create([
'resource' => $this->resource,
'messageController' => $this->messageController,
'configuration' => $this->configuration,
'operationProcessor' => $this->operationProcessor,
'logger' => $this->logger,
'registry' => $this->registry,
'queue' => $queue,
]);
return function (EnvelopeInterface $message) use ($callbackInstance) {
Expand Down

0 comments on commit dad12c6

Please sign in to comment.