PHP Doku:: The consume purpose - amqpqueue.consume.html

Verlauf / Chronik / History: (11) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteAMQPThe AMQPQueue classAMQPQueue::consume

Ein Service von Reinhard Neidl - Webprogrammierung.

The AMQPQueue class

<<AMQPQueue::__construct

AMQPQueue::declare>>

AMQPQueue::consume

(PECL amqp >= Unknown)

AMQPQueue::consumeThe consume purpose

Beschreibung

public void AMQPQueue::consume ( array $options )

Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.

Parameter-Liste

options

options is a an array of consume options. The keys used in the options array are: min, max, and ack. All other keys will be ignored.

For each missing option, the extension will check the ini settings or use the default value.

Rückgabewerte

An array contained a the messages consumed. The number of returned messages will be at least the number given by min in the options array. But not more than the number given by max.

Beispiele

Beispiel #1 AMQPQueue::consume() example

<?php

/* Create a connection using all default credentials: */
$connection = new AMQPConnection();
$connection->connect();

/* create a queue object */
$queue = new AMQPQueue($connection);

//declare the queue
$queue->declare('myqueue');

$options = array(
 
'min' => 1,
 
'max' => 10,
 
'ack' => true
);

//get the messages
$messages $queue->consume($options);

foreach (
$messages as $message) {
 echo 
$message['message_body'];
}

?>


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)