AMQPChannel
PHP 手册

AMQPChannel::setPrefetchCount

(PECL amqp >= Unknown)

AMQPChannel::setPrefetchCountSet the number of messages to prefetch from the broker

说明

public void AMQPChannel::setPrefetchCount ( int $count )

Set the number of messages to prefetch from the broker during a call to AMQPQueue::consume() or AMQPQueue::get(). Any call to this method will automatically set the prefetch window size to 0, meaning that the prefetch window size setting will be ignored.

If the call to either AMQPQueue::consume() or AMQPQueue::get() is done with the AMQP_AUTOACK flag set, this setting will be ignored.

参数

count

The number of messages to prefetch.

错误/异常

Throws AMQPConnectionException if the connection to the broker was lost.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE


AMQPChannel
PHP 手册