You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class AsyncProcessor implements Processor
{
/**
* @var Registry
*/
private $registry;
/**
* @var AsyncEventDispatcher
*/
private $dispatcher;
public function __construct(Registry $registry, EventDispatcherInterface $dispatcher)
{
$this->registry = $registry;
if (false == $dispatcher instanceof AsyncEventDispatcher) {
throw new \InvalidArgumentException(sprintf('The dispatcher argument must be instance of "%s" but got "%s"', AsyncEventDispatcher::class, $dispatcher::class));
}
$this->dispatcher = $dispatcher;
}
public function process(Message $message, Context $context)
{
if (false == $eventName = $message->getProperty('event_name')) {
return Result::reject('The message is missing "event_name" property');
}
if (false == $transformerName = $message->getProperty('transformer_name')) {
return Result::reject('The message is missing "transformer_name" property');