I don't know the best practices on multi-threadfs beanstalkd consumers.  In 
fact there might not be any -- all of my consumers are single threaded and thus 
I've never had this problem.  

You can't delete a job that another client has reserved so using 2 clients 
won't work.  Why not encapsulate the whole client into your thread (so - 1 
client per thread)?  Otherwise you have an obvious bottleneck built into your 
multithreaded system (as you are observing.)  

-- chad


On Tuesday, August 27, 2013 at 10:20 PM, 进中关 wrote:

> may be you can use reserve-with-timeout, or use two connetions
>  
>  
> 2013/8/27 OmarShariffDontLikeIt <[email protected] 
> (mailto:[email protected])>
> > HI!
> >  
> > I in the process of writing a multi-threaded client which uses beanstalkd. 
> > My question boils down to this: if I have a thread trying to reserve a job 
> > from beanstalk, this thread blocks until a job is available. However in 
> > other threads I have processing of jobs underway, which require the ability 
> > to modify the job in beanstalkd i.e. bury, put in another tube etc; However 
> > the beanstalkd connection is blocked, waiting for a new job (which there 
> > may not be) so it is impossible for my app to complete the processing of 
> > jobs that are currently underway.  
> >  
> > Question is: is the best practice to open two connections to beanstalkd 
> > e.g. one to handle blocking reserves and another to handle puts, burys etc. 
> > or is there an easy way to 'break' the reserve so that I can stop sending 
> > reserve requests to the shared connection and complete my job processing 
> > before safely shutting down?  
> >  
> > I'd appreciate your ideas and thoughts.
> >  
> > Cheers,
> > Ben
> >  
> >  
> > --  
> > You received this message because you are subscribed to the Google Groups 
> > "beanstalk-talk" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected] 
> > (mailto:beanstalk-talk%[email protected]).
> > To post to this group, send email to [email protected] 
> > (mailto:[email protected]).
> > Visit this group at http://groups.google.com/group/beanstalk-talk.
> > For more options, visit https://groups.google.com/groups/opt_out.
>  
> --  
> You received this message because you are subscribed to the Google Groups 
> "beanstalk-talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> (mailto:[email protected]).
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> Visit this group at http://groups.google.com/group/beanstalk-talk.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/beanstalk-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to