Hi there,

I suspect I know the answer to this already but I'm a little unsure and 
would appreciate the clarification.  I'm using beanstalk very successfully, 
and want to ensure that it delivers high availability.  There didn't seem to 
be an obvious way to do this and I was intending to adapt my PHP wrapper to 
try servers in turn when publishing, and to connect and listen to several 
servers when consuming.  But then I discovered the Pool class, and I found 
the Ruby implementation of it.  
http://search.cpan.org/~gbarr/Beanstalk-Client/lib/Beanstalk/Pool.pm suggests 
that Perl hasn't got around to implementing it yet and I can't find a PHP 
implementation.

Looking at the Ruby, it appears that the reserve command is sent to a random 
server:

def reserve(timeout=nil)
      send_to_rand_conn(:reserve, timeout)
end


So, if that's the case, how would a worker know that a job was available on 
a server other than the one it sent the reserve to?  Is it simply a matter 
of running enough workers that there's always at least one watching each 
beanstalkd server?  Is that the generally recommended way of implementing a 
pool class (if I were to write one in PHP)?  Would it be better to have each 
worker connected to all (or at least several) beanstalk servers, and if so, 
any suggestions for how a single threaded worker should alternate between 
servers?

And are there any PHP client libraries I'm not aware of that already have 
this kind of functionality?

Andrew

-- 
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/beanstalk-talk/-/rtYNdq1FYisJ.
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=en.

Reply via email to