PHP 클래스 AMQPChannel

파일 보기 프로젝트 열기: pdezwart/php-amqp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( AMQPConnection $amqp_connection ) Create an instance of an AMQPChannel object.
basicRecover ( boolean $requeue = true ) Redeliver unacknowledged messages.
close ( ) Closes the channel.
commitTransaction ( ) : boolean Commit a pending transaction.
confirmSelect ( ) Set the channel to use publisher acknowledgements. This can only used on a non-transactional channel.
getChannelId ( ) : integer Return internal channel ID
getConnection ( ) : AMQPConnection Get the AMQPConnection object in use
getPrefetchCount ( ) : integer Get the number of messages to prefetch from the broker.
getPrefetchSize ( ) : integer Get the window size to prefetch from the broker.
isConnected ( ) : boolean Check the channel connection.
qos ( integer $size, integer $count ) : boolean Set the Quality Of Service settings for the given channel.
rollbackTransaction ( ) : boolean Rollback a transaction.
setConfirmCallback ( callable $ack_callback = null, callable $nack_callback = null ) Set callback to process basic.ack and basic.nac AMQP server methods (applicable when channel in confirm mode).
setPrefetchCount ( integer $count ) : boolean Set the number of messages to prefetch from the broker.
setPrefetchSize ( integer $size ) : boolean Set the window size to prefetch from the broker.
setReturnCallback ( callable $return_callback = null ) Set callback to process basic.return AMQP server method
startTransaction ( ) : boolean Start a transaction.
waitForBasicReturn ( float $timeout ) Start wait loop for basic.return AMQP server methods
waitForConfirm ( float $timeout ) Wait until all messages published since the last call have been either ack'd or nack'd by the broker.

메소드 상세

__construct() 공개 메소드

Create an instance of an AMQPChannel object.
public __construct ( AMQPConnection $amqp_connection )
$amqp_connection AMQPConnection An instance of AMQPConnection with an active connection to a broker.

basicRecover() 공개 메소드

Redeliver unacknowledged messages.
public basicRecover ( boolean $requeue = true )
$requeue boolean

close() 공개 메소드

Closes the channel.
public close ( )

commitTransaction() 공개 메소드

Commit a pending transaction.
public commitTransaction ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

confirmSelect() 공개 메소드

Set the channel to use publisher acknowledgements. This can only used on a non-transactional channel.
public confirmSelect ( )

getChannelId() 공개 메소드

Return internal channel ID
public getChannelId ( ) : integer
리턴 integer

getConnection() 공개 메소드

Get the AMQPConnection object in use
public getConnection ( ) : AMQPConnection
리턴 AMQPConnection

getPrefetchCount() 공개 메소드

Get the number of messages to prefetch from the broker.
public getPrefetchCount ( ) : integer
리턴 integer

getPrefetchSize() 공개 메소드

Get the window size to prefetch from the broker.
public getPrefetchSize ( ) : integer
리턴 integer

isConnected() 공개 메소드

Check the channel connection.
public isConnected ( ) : boolean
리턴 boolean Indicates whether the channel is connected.

qos() 공개 메소드

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.
리턴 boolean TRUE on success or FALSE on failure.

rollbackTransaction() 공개 메소드

Rollback an existing transaction. AMQPChannel::startTransaction() must be called prior to this.
public rollbackTransaction ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

setConfirmCallback() 공개 메소드

Set callback to process basic.ack and basic.nac AMQP server methods (applicable when channel in confirm mode).
public setConfirmCallback ( callable $ack_callback = null, callable $nack_callback = null )
$ack_callback callable
$nack_callback callable Callback functions with all arguments have the following signature: function ack_callback(int $delivery_tag, bool $multiple) : bool; function nack_callback(int $delivery_tag, bool $multiple, bool $requeue) : bool; and should return boolean false when wait loop should be canceled. Note, basic.nack server method will only be delivered if an internal error occurs in the Erlang process responsible for a queue (see https://www.rabbitmq.com/confirms.html for details).

setPrefetchCount() 공개 메소드

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.
public setPrefetchCount ( integer $count ) : boolean
$count integer The number of messages to prefetch.
리턴 boolean TRUE on success or FALSE on failure.

setPrefetchSize() 공개 메소드

Set the prefetch window size, in octets, during a call to AMQPQueue::consume() or AMQPQueue::get(). Any call to this method will automatically set the prefetch message count to 0, meaning that the prefetch message count 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.
public setPrefetchSize ( integer $size ) : boolean
$size integer The window size, in octets, to prefetch.
리턴 boolean TRUE on success or FALSE on failure.

setReturnCallback() 공개 메소드

Set callback to process basic.return AMQP server method
public setReturnCallback ( callable $return_callback = null )
$return_callback callable Callback function with all arguments has the following signature: function callback(int $reply_code, string $reply_text, string $exchange, string $routing_key, AMQPBasicProperties $properties, string $body) : bool; and should return boolean false when wait loop should be canceled.

startTransaction() 공개 메소드

This method must be called on the given channel prior to calling AMQPChannel::commitTransaction() or AMQPChannel::rollbackTransaction().
public startTransaction ( ) : boolean
리턴 boolean TRUE on success or FALSE on failure.

waitForBasicReturn() 공개 메소드

Start wait loop for basic.return AMQP server methods
public waitForBasicReturn ( float $timeout )
$timeout float Timeout in seconds. May be fractional.

waitForConfirm() 공개 메소드

Note, this method also catch all basic.return message from server.
public waitForConfirm ( float $timeout )
$timeout float Timeout in seconds. May be fractional.