Permalink
Browse files

fixes consumer shutdown function

  • Loading branch information...
1 parent 068ab91 commit c12029a1f4499560a4c13f64b2c1b93964b706c4 @videlalvaro videlalvaro committed Oct 9, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 demo/amqp_consumer.php
View
@@ -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();
+function shutdown($ch, $conn){
+ $ch->close();
+ $conn->close();
}
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();
}
?>

0 comments on commit c12029a

Please sign in to comment.