That code looks perfectly fine to me.  I'm a Ruby developer and
haven't had any issues with CPU utilization in a similarly configured
loop.  When the reserve method is called, it waits for beanstalk to
respond and CPU stays pretty much at 0% until the job comes in.

Michael
On Wed, Nov 11, 2009 at 11:22 AM, Alexander Kunz <[email protected]> wrote:
>
> Hello Miacheal,
>
> thanks for your fast reponse. I use the following php code, this time
> there is no loop...
>
> <?php
>
>    require('BeanStalk.class.php');
>
>    $beanstalk = BeanStalk::open(array(
>        'servers'       => array( '127.0.0.1:11300' ),
>        'select'        => 'random peek'
>    ));
>
>    $beanstalk->use_tube('test');
>
>    $job = $beanstalk->reserve();
>
>    echo $job->get();
>    Beanstalk::delete($job);
>
> ?>
>
>
>
>
> Michael Lang wrote:
>> Sounds like you're using something other than $beanstalk->reserve();
>> in your loop.  Does the examples from the PHP client (which do
>> demonstrate using "reserve") also use 100% CPU?
>>
>> Michael
>>
>> On Wed, Nov 11, 2009 at 8:54 AM, Alexander Kunz <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> i am searching a simple beanstalkd client for PHP. I try
>>> BeanStalk.class.php from
>>> http://sourceforge.net/projects/beanstalk/. But my script use 100% cpu power
>>> when the queue is empty. I get this too when i use the inclued example,
>>> it use also
>>> 100% of my Cpu power.
>>>
>>> Are there any other simple beanstalkd classes on the net?
>>>
>>> Kind regrads
>>>
>>> --
>>>
>>> You received this message because you are subscribed to the Google Groups 
>>> "beanstalk-talk" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group at 
>>> http://groups.google.com/group/beanstalk-talk?hl=.
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "beanstalk-talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/beanstalk-talk?hl=.
>
>
>



-- 
http://codeconnoisseur.org

--

You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/beanstalk-talk?hl=.


Reply via email to