<HTML>
<HEAD>
<TITLE>Re: [rabbitmq-discuss] PHP Client libraries</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hey guys,<BR>
<BR>
Just FYI, I have a mostly working php-rabbit patch. Using the demo script I can declare, bind, publish and consume. I ran into a segfault when I tried to incorporate it into our framework, so there is still some debugging to do there.<BR>
I will submit a patch to everyone later today, with the understanding that I make no guarantees as to whether it is production ready.<BR>
<BR>
Pieter<BR>
<BR>
<BR>
On 2/9/10 3:00 AM, "Alexandre Kalendarev" <<a href="akalend@mail.ru">akalend@mail.ru</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Dieter,<BR>
<BR>
> thank you for your reply. Am I right, the module does not support<BR>
> consuming messages?<BR>
<BR>
The module is support Consume and Get methods. But Consume<BR>
methods is sync and GET is async.<BR>
<BR>
If You use the the consume in the WEB pages, the HTTP protocol is async and You can't wait if you have not commet technology.<BR>
My recomendation is use the series of GET method:<BR>
<BR>
// get queue items<BR>
$queue = new AMQPQueue(APMQConection(), 'my_queue');<BR>
$i=0;<BR>
$res = true;<BR>
while ($res = $queue->get() !== false ){<BR>
$i++;<BR>
echo "$i : {$res['msg']}<br>\n";<BR>
}<BR>
<BR>
But, You can use the Consume, You must the read queue lenght and make Consume of len messages.<BR>
It is guarantie of absent waiting new messages.<BR>
<BR>
<BR>
// consume<BR>
$i=0;<BR>
$queue = new AMQPQueue(APMQConection());<BR>
<BR>
$n = $queue->declare('my_queue'); // we get the lenght of queue<BR>
<BR>
$queueMessages = $queue->consume( $n ); // we reading $n messages, all queue.<BR>
foreach($queueMessages as $item){<BR>
$i++;<BR>
echo "$i.$item";<BR>
}<BR>
<BR>
If $n less lenght of queue, the all nonreaded messages will be gone.<BR>
<BR>
The Consume method is faster.<BR>
<BR>
>Or Am i mixing up the Modules?<BR>
the module php-amqp <a href="http://code.google.com/p/php-amqp/">http://code.google.com/p/php-amqp/</a> don't support consume, bind and queue. It is only publish.<BR>
<BR>
If You have any questions send me, I will very happeness ask You. Sorry for my English.<BR>
<BR>
Alexandre<BR>
<BR>
_______________________________________________<BR>
rabbitmq-discuss mailing list<BR>
<a href="rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><BR>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
-- <BR>
</SPAN></FONT><FONT COLOR="#343434"><FONT SIZE="4"><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:14pt'>the rubicon project<BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><FONT COLOR="#BA0022"><FONT SIZE="1"><SPAN STYLE='font-size:9pt'><BR>
</SPAN><SPAN STYLE='font-size:7pt'>PIETER DE ZWART </SPAN></FONT></FONT><FONT SIZE="1"><SPAN STYLE='font-size:7pt'><FONT COLOR="#404040">| INTERFACES ENGINEER<BR>
</FONT><FONT COLOR="#AC0021"><BR>
</FONT><FONT COLOR="#BB001E">••• P 310 207 0272 | x224<BR>
••• F 323 466 7119<BR>
</FONT><BR>
<FONT COLOR="#3C3C3C"><BR>
1925 S. BUNDY DRIVE<BR>
LOS ANGELES, CALIFORNIA 90025<BR>
</FONT><FONT COLOR="#B60F1D"><BR>
</FONT><FONT COLOR="#0000FF">WWW.RUBICONPROJECT.COM</FONT><FONT COLOR="#B60F1D"> <</FONT><FONT COLOR="#0000FF"><U><a href="http://">http://</a>www.rubiconproject.com/</U></FONT><FONT COLOR="#B60F1D">> <BR>
</FONT></SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT COLOR="#2F2F2F"><FONT SIZE="4"><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:13pt'><IMG src="cid:3348550043_415745" ><BR>
</SPAN></FONT></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><FONT COLOR="#787878"><FONT SIZE="1"><SPAN STYLE='font-size:7pt'>“COMPANY OF THE YEAR” ALWAYSON ONMEDIA 2009<BR>
#24 ON FAST COMPANY FAST 50 READER FAVORITES<BR>
2008 ALWAYSON 250 GLOBAL WINNER<BR>
2008 ALWAYSON ONMEDIA 100 WINNER<BR>
TWIISTUP3 BEST IN SHOW<BR>
</SPAN></FONT></FONT><FONT SIZE="1"><SPAN STYLE='font-size:7pt'><FONT COLOR="#777777">PRICEWATERHOUSECOOPERS – ENTRETECH BEST STARTUP<BR>
</FONT><FONT COLOR="#787878">AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST BEST NEW COMPANY<BR>
</FONT><FONT COLOR="#777777">AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST MOST INNOVATIVE COMPANY<BR>
AMERICAN BUSINESS AWARDS - STEVIES ‘08 FINALIST NEW PRODUCT OR SERVICE - SERVICES<BR>
<BR>
</FONT></SPAN></FONT></FONT><FONT COLOR="#198000"><FONT SIZE="6"><FONT FACE="Webdings"><SPAN STYLE='font-size:24pt'>P</SPAN></FONT></FONT><FONT SIZE="1"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:7pt'> </SPAN></FONT><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:8pt'>Please consider the environment before printing this e-mail</SPAN></FONT></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>