3 namespace Wallabag\ImportBundle\Redis
;
5 use OldSound\RabbitMqBundle\RabbitMq\ProducerInterface
;
6 use Simpleue\Queue\RedisQueue
;
9 * This is a proxy class for "Simpleue\Queue\RedisQueue".
10 * It allow us to use the same way to publish a message between RabbitMQ & Redis: publish().
12 * It implements the ProducerInterface of RabbitMQ (yes it's ugly) so we can have the same
13 * kind of class which implements the same interface.
14 * So we can inject either a RabbitMQ producer or a Redis producer with the same signature
16 class Producer
implements ProducerInterface
20 public function __construct(RedisQueue
$queue)
22 $this->queue
= $queue;
26 * Publish a message in the Redis queue.
28 * @param string $msgBody
29 * @param string $routingKey NOT USED
30 * @param array $additionalProperties NOT USED
32 public function publish($msgBody, $routingKey = '', $additionalProperties = array())
34 $this->queue
->sendJob($msgBody);