Consume Msg and return to another class

37 views
Skip to first unread message

Ruben

unread,
Sep 25, 2015, 10:43:42 AM9/25/15
to php-amqplib-devel
Hello Now my callback function can make a print(echo or print) of the response of the server, but i want return this value, outside of Callback function like this 

$msg_answer="";
function process_message($msg){
 echo $msg
->body; //this print a object
        $msg_answer
=$msg->body;
       


         
return $msg->body;
 
 
};
$ch
->basic_consume($queue_name, 'sportbetperu-Consumer', false, false, false, false, 'process_message');



//close
//close


return msg_answer or process_message//  i try with $callback = function($msg)..... and try return $callback, but that is null

Reply all
Reply to author
Forward
0 new messages