2021-03-31 11:00:48 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace RetailCrm\ServiceBundle\Messenger;
|
|
|
|
|
|
|
|
use RetailCrm\ServiceBundle\Messenger\MessageHandler\JobRunner;
|
|
|
|
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
|
|
|
use Exception;
|
|
|
|
|
|
|
|
class MessageHandler implements MessageHandlerInterface
|
|
|
|
{
|
2022-07-20 14:38:42 +03:00
|
|
|
public function __construct(private JobRunner $runner)
|
2021-03-31 11:00:48 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public function __invoke(CommandMessage $message): void
|
|
|
|
{
|
|
|
|
$this->runner->run($message);
|
|
|
|
}
|
|
|
|
}
|