1
0
mirror of synced 2024-11-24 22:06:06 +03:00
service-bundle/Messenger/MessageHandler.php
2021-03-31 11:00:48 +03:00

41 lines
787 B
PHP

<?php
namespace RetailCrm\ServiceBundle\Messenger;
use RetailCrm\ServiceBundle\Messenger\MessageHandler\JobRunner;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
use Exception;
/**
* Class MessageHandler
*
* @package RetailCrm\ServiceBundle\Messenger
*/
class MessageHandler implements MessageHandlerInterface
{
/**
* @var JobRunner
*/
private $runner;
/**
* CommandQueueHandler constructor.
*
* @param JobRunner $runner
*/
public function __construct(JobRunner $runner)
{
$this->runner = $runner;
}
/**
* @param CommandMessage $message
*
* @throws Exception
*/
public function __invoke(CommandMessage $message): void
{
$this->runner->run($message);
}
}