1

I need to use beanstalked in my project.So I download the 1.1 version. I use the beanstalkc for python client. A simple Producer-Consumer model.

Producer:

       import beanstalkc
       beanstalk = beanstalkc.Connection('localhost')
       beanstalk.use('foo')
       beanstalk.put('hello')
       beanstalk.put('world')

Consumer:

      import beanstalkc
      beanstalk.use('foo')
      beanstalk = beanstalkc.Connection('localhost')
      job = beanstalk.reserve()

But the reserve operation is blocked for a long time.Has anybody encounter this problem?

J. Ghyllebert
  • 2,009
  • 1
  • 29
  • 35
GeekDemo
  • 13
  • 3
  • I have resolved this problem.Because the "use" command is for producers.The consumer must be use 'wath' command.The "watch" command adds the named tube to the watch list for the current connection. A reserve command will take a job from any of the tubes in the watch list.so The Consumser import beanstalkc beanstalk.watch('foo') beanstalk = beanstalkc.Connection('localhost') job = beanstalk.reserve() – GeekDemo Nov 25 '14 at 02:14
  • possible duplicate of [Unable to reserve a job with beanstalkd](http://stackoverflow.com/questions/2818184/unable-to-reserve-a-job-with-beanstalkd) – Alister Bulman Nov 27 '14 at 13:45

0 Answers0