-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Is WATCH not allowed while in RESERVE call? Is this the way beanstalkd works or is it fivebeans?
In the below code, first reserve command is run and then watch command after 2 secs, but watch command callback is never run.
consumer.js
var fivebeans = require('fivebeans');
var client = new fivebeans.client('127.0.0.1', 11300);
client
.on('connect', function () {
console.log('Connected');
})
.on('error', function (err) {
// connection failure
})
.on('close', function () {
// underlying connection has closed
})
.connect();
client.reserve(function (err, jobid, payload) {
if (err) { console.log(err) }
console.log(`Job Id ${jobid}`);
console.log(`Job data ${payload.toString()}`);
client.destroy(jobid, function (err) {
if (err) { console.log(err) }
console.log(`Job deleted ${jobid}`);
});
});
setTimeout(() => {
console.log('going to watch')
client.watch('low-volume', (err, tubecount) => {
console.log(err);
console.log(tubecount);
})
}, 2000)
Output
Connetced
going to watch
apmcodes
Metadata
Metadata
Assignees
Labels
No labels