Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function handle(CommandInterface $command, $priority = null)
 {
     $this->eventDispatcher->dispatch(Event\Events::PRE_HANDLE_COMMAND, new Event\PreHandleCommandEvent($this, $command));
     $serializedCommand = $this->serializer->serialize($command);
     if ($this->logger) {
         $this->logger->info(sprintf('[RedisCommandBus] Add command [%s] with content [%s] to the queue', get_class($command), $serializedCommand));
     }
     $redisMethod = $priority >= CommandBusInterface::PRIORITY_HIGH ? 'lpush' : 'rpush';
     $this->client->{$redisMethod}($this->keyGenerator->generate(get_class($command)), $serializedCommand);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function handle(CommandInterface $command, $priority = null)
 {
     $serializedCommand = $this->serializer->serialize($command);
     $redisMethod = $priority >= CommandBusInterface::PRIORITY_HIGH ? 'lpush' : 'rpush';
     $this->client->{$redisMethod}($this->keyGenerator->generate(get_class($command)), $serializedCommand);
 }