Sets the interval of time to wait for income activity from AMQP broker
public setReadTimeout ( integer $timeout ) : boolean | ||
$timeout | integer | |
return | boolean |
/** * @param string $host * @param int $port * @param string $vhost * @param string $login * @param string $password * @param float $connectionTimeout * @return AMQPConnection * @throws AMQPConnectionException * @throws Exception */ protected function createAMQPConnection($host, $port, $vhost, $login, $password, $connectionTimeout) { $connection = new AMQPConnection(); $connection->setHost($host); $connection->setPort($port); $connection->setVhost($vhost); $connection->setLogin($login); $connection->setPassword($password); $connection->setReadTimeout($connectionTimeout); if (!$connection->connect()) { throw new Exception('Cannot connect to the broker'); } return $connection; }