Doc #62482 [Opn]: Documentation invalid

From: Date: Fri, 20 Jul 2012 09:11:21 +0000
Subject: Doc #62482 [Opn]: Documentation invalid
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8611@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62482&edit=1 ID: 62482 Updated by: aharvey@php.net Reported by: cg-php at charlesgentry dot com Summary: Documentation invalid Status: Open Type: Documentation Problem -Package: Documentation problem +Package: amqp PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I don't know if there's a lot of knowledge of amqp among the usual doc contributors. Pieter, can you have a look if the example in the report is better for that method, please? Previous Comments: ------------------------------------------------------------------------ [2012-07-04 15:19:08] cg-php at charlesgentry dot com Description: ------------ --- From manual page: http://www.php.net/amqpqueue.consume#refsect1-amqpqueue.consume-examples --- <?php /* Create a connection using all default credentials: */ $connection = new AMQPConnection(); $connection->connect(); $channel = new AMQPChannel($connection); /* Create an exchange. This is optional but you must bind the queue * to a valid name or get an error */ $ex = new AMQPExchange( $channel ); /* Give it a name */ $ex->setName( 'myExchange' ); /* Set it as a direct (or point-to-point) type */ $ex->setType( AMQP_EX_TYPE_DIRECT ); /* Tell it to delete when empty */ $ex->setFlags( AMQP_AUTODELETE ); /* Create the exchange */ $ex->declare(); /* create a queue object */ $queue = new AMQPQueue($channel); /* Start the queue up */ $queue->declare( ); /* Attach the queue to an exchange */ $queue->bind( 'myExchange' , 'routing_key' ); $i = 0; function processMessage($envelope, $queue) { global $i; echo "Message $i: " . $envelope->getBody() . "\n"; $i++; if ($i > 10) { // Bail after 10 messages return false; } } // Consume messages on queue $queue->consume("processMessage"); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62482&edit=1

« previous php.doc.bugs (#8611) next »