AMQPChannel::qos PHP Method

qos() public method

Specify the amount of data to prefetch in terms of window size (octets) or number of messages from a queue during a AMQPQueue::consume() or AMQPQueue::get() method call. The client will prefetch data up to size octets or count messages from the server, whichever limit is hit first. Setting either value to 0 will instruct the client to ignore that particular setting. A call to AMQPChannel::qos() will overwrite any values set by calling AMQPChannel::setPrefetchSize() and AMQPChannel::setPrefetchCount(). If the call to either AMQPQueue::consume() or AMQPQueue::get() is done with the AMQP_AUTOACK flag set, the client will not do any prefetching of data, regardless of the QOS settings.
public qos ( integer $size, integer $count ) : boolean
$size integer The window size, in octets, to prefetch.
$count integer The number of messages to prefetch.
return boolean TRUE on success or FALSE on failure.
    public function qos($size, $count)
    {
    }

Usage Example

Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function basicQos($prefetchSize, $prefetchCount)
 {
     try {
         return $this->delegate->qos($prefetchSize, $prefetchCount);
     } catch (\AMQPChannelException $e) {
         throw new ChannelException($e->getMessage(), $e->getCode(), $e);
     } catch (\AMQPConnectionException $e) {
         throw new ConnectionException($e->getMessage(), $e->getCode(), $e);
     }
 }
All Usage Examples Of AMQPChannel::qos