AMQPChannel
class AMQPChannel (View source)
stub class representing AMQPChannel from pecl-amqp
Methods
Commit a pending transaction.
Check the channel connection.
Closes the channel.
Return internal channel ID
Set the Quality Of Service settings for the given channel.
Rollback a transaction.
Set the number of messages to prefetch from the broker for each consumer.
Get the number of messages to prefetch from the broker for each consumer.
Set the window size to prefetch from the broker for each consumer.
Get the window size to prefetch from the broker for each consumer.
Set the number of messages to prefetch from the broker across all consumers.
Get the number of messages to prefetch from the broker across all consumers.
Set the window size to prefetch from the broker for all consumers.
Get the window size to prefetch from the broker for all consumers.
Start a transaction.
Get the AMQPConnection object in use
Redeliver unacknowledged messages.
Set the channel to use publisher acknowledgements. This can only used on a non-transactional channel.
Set callback to process basic.ack and basic.nac AMQP server methods (applicable when channel in confirm mode).
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
Set callback to process basic.return AMQP server method
Start wait loop for basic.return AMQP server methods
Return array of current consumers where key is consumer and value is AMQPQueue consumer is running on
Details
void
commitTransaction()
Commit a pending transaction.
__construct(AMQPConnection $amqp_connection)
Create an instance of an AMQPChannel object.
bool
isConnected()
Check the channel connection.
void
close()
Closes the channel.
int
getChannelId()
Return internal channel ID
void
qos(int $size, int $count, bool $global = false)
Set the Quality Of Service settings for the given channel.
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.
void
rollbackTransaction()
Rollback a transaction.
Rollback an existing transaction. AMQPChannel::startTransaction() must be called prior to this.
void
setPrefetchCount(int $count)
Set the number of messages to prefetch from the broker for each consumer.
Set the number of messages to prefetch from the broker during a call to AMQPQueue::consume() or AMQPQueue::get().
int
getPrefetchCount()
Get the number of messages to prefetch from the broker for each consumer.
void
setPrefetchSize(int $size)
Set the window size to prefetch from the broker for each consumer.
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.
int
getPrefetchSize()
Get the window size to prefetch from the broker for each consumer.
void
setGlobalPrefetchCount(int $count)
Set the number of messages to prefetch from the broker across all consumers.
Set the number of messages to prefetch from the broker during a call to AMQPQueue::consume() or AMQPQueue::get().
int
getGlobalPrefetchCount()
Get the number of messages to prefetch from the broker across all consumers.
void
setGlobalPrefetchSize(int $size)
Set the window size to prefetch from the broker for all consumers.
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.
int
getGlobalPrefetchSize()
Get the window size to prefetch from the broker for all consumers.
void
startTransaction()
Start a transaction.
This method must be called on the given channel prior to calling AMQPChannel::commitTransaction() or AMQPChannel::rollbackTransaction().
AMQPConnection
getConnection()
Get the AMQPConnection object in use
void
basicRecover(bool $requeue = true)
Redeliver unacknowledged messages.
void
confirmSelect()
Set the channel to use publisher acknowledgements. This can only used on a non-transactional channel.
void
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).
void
waitForConfirm(float $timeout = 0.0)
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
Note, this method also catch all basic.return message from server.
void
setReturnCallback(callable $return_callback = null)
Set callback to process basic.return AMQP server method
void
waitForBasicReturn(float $timeout = 0.0)
Start wait loop for basic.return AMQP server methods
AMQPQueue[]
getConsumers()
Return array of current consumers where key is consumer and value is AMQPQueue consumer is running on