Skip to content
Browse files

improves examples

  • Loading branch information...
1 parent b6e0bb2 commit 07fdbeaab6a29d4bfd0d07fff8e2f7592e4ad867 @videlalvaro videlalvaro committed Nov 14, 2011
Showing with 6 additions and 6 deletions.
  1. +5 −5 demo/amqp_consumer.php
  2. +1 −1 demo/amqp_publisher.php
View
10 demo/amqp_consumer.php
@@ -65,15 +65,15 @@ function process_message($msg) {
$ch->basic_consume($queue, $consumer_tag, false, false, false, false, 'process_message');
-// Loop as long as the channel has callbacks registered
-while(count($ch->callbacks)) {
- $ch->wait();
-}
-
register_shutdown_function('shutdown', $ch, $conn);
function shutdown($ch, $conn){
$ch->close();
$conn->close();
}
+
+// Loop as long as the channel has callbacks registered
+while(count($ch->callbacks)) {
+ $ch->wait();
+}
?>
View
2 demo/amqp_publisher.php
@@ -37,7 +37,7 @@
$ch->queue_bind($queue, $exchange);
$msg_body = implode(' ', array_slice($argv, 1));
-$msg = new AMQPMessage($msg_body, array('content_type' => 'text/plain'));
+$msg = new AMQPMessage($msg_body, array('content_type' => 'text/plain', 'delivery-mode' => 2));
$ch->basic_publish($msg, $exchange);
$ch->close();

0 comments on commit 07fdbea

Please sign in to comment.
Something went wrong with that request. Please try again.