<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="swarrot.factory.pecl.class">Swarrot\SwarrotBundle\Broker\PeclFactory</parameter>
        <parameter key="swarrot.factory.amqp_lib.class">Swarrot\SwarrotBundle\Broker\AmqpLibFactory</parameter>
        <parameter key="swarrot.command.base.class">Swarrot\SwarrotBundle\Command\SwarrotCommand</parameter>
        <parameter key="swarrot.publisher.class">Swarrot\SwarrotBundle\Broker\Publisher</parameter>
    </parameters>

    <services>
        <service id="swarrot.factory.pecl" class="%swarrot.factory.pecl.class%">
            <tag name="swarrot.provider_factory" alias="pecl"/>
        </service>
        <service id="swarrot.factory.amqp_lib" class="%swarrot.factory.amqp_lib.class%">
            <tag name="swarrot.provider_factory" alias="amqp_lib"/>
        </service>

        <service id="swarrot.command.base" class="%swarrot.command.base.class%" abstract="true">
            <argument /> <!-- name -->
            <argument /> <!-- connection name -->
            <argument /> <!-- processor -->
            <argument /> <!-- processor stack -->
            <argument /> <!-- extra -->
            <argument type="service" id="logger" />
            <argument /> <!-- queue -->
            <call method="setContainer">
                <argument type="service" id="service_container" />
            </call>
        </service>

        <service id="swarrot.publisher" class="%swarrot.publisher.class%">
            <argument type="service" id="swarrot.factory.default" />
            <argument type="service" id="event_dispatcher" />
            <argument>%swarrot.messages_types%</argument>
            <argument type="service" id="swarrot.logger" />
        </service>

        <service id="swarrot.logger.null" class="Psr\Log\NullLogger" public="false" />
    </services>
</container>
