[rabbitmq-discuss] PHP Client libraries
Pieter de Zwart
pdezwart at rubiconproject.com
Tue Feb 9 16:47:23 GMT 2010
Hey guys,
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.
I will submit a patch to everyone later today, with the understanding that I
make no guarantees as to whether it is production ready.
Pieter
On 2/9/10 3:00 AM, "Alexandre Kalendarev" <akalend at mail.ru> wrote:
> Hi Dieter,
>
>> > thank you for your reply. Am I right, the module does not support
>> > consuming messages?
>
> The module is support Consume and Get methods. But Consume
> methods is sync and GET is async.
>
> 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.
> My recomendation is use the series of GET method:
>
> // get queue items
> $queue = new AMQPQueue(APMQConection(), 'my_queue');
> $i=0;
> $res = true;
> while ($res = $queue->get() !== false ){
> $i++;
> echo "$i : {$res['msg']}<br>\n";
> }
>
> But, You can use the Consume, You must the read queue lenght and make Consume
> of len messages.
> It is guarantie of absent waiting new messages.
>
>
> // consume
> $i=0;
> $queue = new AMQPQueue(APMQConection());
>
> $n = $queue->declare('my_queue'); // we get the lenght of queue
>
> $queueMessages = $queue->consume( $n ); // we reading $n messages, all queue.
> foreach($queueMessages as $item){
> $i++;
> echo "$i.$item";
> }
>
> If $n less lenght of queue, the all nonreaded messages will be gone.
>
> The Consume method is faster.
>
>> >Or Am i mixing up the Modules?
> the module php-amqp http://code.google.com/p/php-amqp/ don't support
> consume, bind and queue. It is only publish.
>
> If You have any questions send me, I will very happeness ask You. Sorry for my
> English.
>
> Alexandre
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
--
the rubicon project
PIETER DE ZWART | INTERFACES ENGINEER
P 310 207 0272 | x224
F 323 466 7119
1925 S. BUNDY DRIVE
LOS ANGELES, CALIFORNIA 90025
WWW.RUBICONPROJECT.COM <http://www.rubiconproject.com/>
³COMPANY OF THE YEAR² ALWAYSON ONMEDIA 2009
#24 ON FAST COMPANY FAST 50 READER FAVORITES
2008 ALWAYSON 250 GLOBAL WINNER
2008 ALWAYSON ONMEDIA 100 WINNER
TWIISTUP3 BEST IN SHOW
PRICEWATERHOUSECOOPERS ENTRETECH BEST STARTUP
AMERICAN BUSINESS AWARDS - STEVIES 08 FINALIST BEST NEW COMPANY
AMERICAN BUSINESS AWARDS - STEVIES 08 FINALIST MOST INNOVATIVE COMPANY
AMERICAN BUSINESS AWARDS - STEVIES 08 FINALIST NEW PRODUCT OR SERVICE -
SERVICES
P Please consider the environment before printing this e-mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100209/33049bcc/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 28320 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20100209/33049bcc/attachment.png
More information about the rabbitmq-discuss
mailing list