private static function build(
        $host,
        $port,
        $user,
        $pass,
        $queueName,
        QueueConsumer $consumer,
        $sync,
        $escapeMode,
        $requeueOnFailure,
        LoggerInterface $logger = null,
        $stopOnFailure = false
    ) {
        $consumer = self::getSerializingConsumer($consumer, $escapeMode);

        $driver = DriverFactory::getDriver([
            'host' => $host,
            'port' => $port,
            'user' => $user,
            'pwd'  => $pass
        ]);

        $builder = new HandlerBuilder($driver);

        if ($sync) {
            $builder->sync($consumer);
        } else {
            $builder->async($consumer);
        }

        if (! $stopOnFailure) {
            $builder->continueOnFailure();
        }

        if (! $requeueOnFailure) {
            $builder->doNotRequeueOnFailure();
        }

        $builder->log(($logger === null) ? new NullLogger() : $logger);

        return new QueueHandlingDaemon($driver, $builder->build(), $queueName);
    }
private static function build(
        $host,
        $port,
        $user,
        $pass,
        $queueName,
        QueueConsumer $consumer,
        $sync,
        $escapeMode,
        $requeueOnFailure,
        LoggerInterface $logger = null,
        $stopOnFailure = false
    ) {
        $consumer = self::getSerializingConsumer($consumer, $escapeMode);

        $driver = DriverFactory::getDriver([
            'host' => $host,
            'port' => $port,
            'user' => $user,
            'pwd'  => $pass
        ]);

        $builder = new HandlerBuilder($driver);

        if ($sync) {
            $builder->sync($consumer);
        } else {
            $builder->async($consumer);
        }

        if (! $stopOnFailure) {
            $builder->continueOnFailure();
        }

        if (! $requeueOnFailure) {
            $builder->doNotRequeueOnFailure();
        }

        $builder->log(($logger === null) ? new NullLogger() : $logger);

        return new QueueHandlingDaemon($driver, $builder->build(), $queueName);
    }
private static function build ( $ host , $ port , $ user , $ pass , $ queueName , QueueConsumer $ consumer , $ sync , $ escapeMode , $ requeueOnFailure , LoggerInterface $ logger = null , $ stopOnFailure = false ) { $ consumer = self :: getSerializingConsumer ( $ consumer , $ escapeMode ) ; $ driver = DriverFactory :: getDriver ( [ 'host' => $ host , 'port' => $ port , 'user' => $ user , 'pwd' => $ pass ] ) ; $ builder = new HandlerBuilder ( $ driver ) ; if ( $ sync ) { $ builder -> sync ( $ consumer ) ; } else { $ builder -> async ( $ consumer ) ; } if ( ! $ stopOnFailure ) { $ builder -> continueOnFailure ( ) ; } if ( ! $ requeueOnFailure ) { $ builder -> doNotRequeueOnFailure ( ) ; } $ builder -> log ( ( $ logger === null ) ? new NullLogger ( ) : $ logger ) ; return new QueueHandlingDaemon ( $ driver , $ builder -> build ( ) , $ queueName ) ; }
Build a daemon

@param string          $host
@param string          $port
@param string          $user
@param string          $pass
@param string          $queueName
@param QueueConsumer   $consumer
@param bool            $sync
@param string          $escapeMode
@param bool            $requeueOnFailure
@param LoggerInterface $logger
@param bool            $stopOnFailure

@return QueueHandlingDaemon
Build a daemon