SAREhub/PHP_Client

View on GitHub
src/SAREhub/Client/Amqp/AmqpProducer.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace SAREhub\Client\Amqp;


use SAREhub\Client\Message\Exchange;
use SAREhub\Client\Processor\Processor;

class AmqpProducer implements Processor
{
    /**
     * @var AmqpChannelWrapper
     */
    private $channel;

    public function __construct(AmqpChannelWrapper $channel)
    {
        $this->channel = $channel;
    }

    public function process(Exchange $exchange)
    {
        $this->getChannel()->publish($exchange->getIn());
    }

    public function getChannel(): AmqpChannelWrapper
    {
        return $this->channel;
    }


}