Closed ghedsouza closed 10 years ago
If you call beanstalk.use('xxx')
before peek_ready(), then it returns None
, as expected.
peek_buried
, peek_delayed
, and peek_ready
operate on the currently _use_d tube. Quoting the official protocol documentation:
"The peek commands let the client inspect a job in the system. There are four variations. All but the first operate only on the currently used tube."
This is a gotcha that deserves a mention in our own tutorial documentation as well. There's already an issue tracking that documentation update: #19.
If you explicitly watch a single empty tube other than 'default', beanstalkc.Connection.peek_ready() will still return jobs from the 'default' tube.
This is an example, where, starting with a completely empty database, peek_ready() should not return a job, but does anyway:
Versions: beanstalkd = 1.9 beanstalkc = 0.4.0