You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the below code, first reserve command is run and then watch command after 2 secs, but watch command callback is never run.
Is watch not allowed after reserve, so is the reserve is hanging blocking the connection and no further command is run? Is this the way beanstalkd works or is this this client library ...
const Beanstalkd = require('beanstalkd').default;
let client = new Beanstalkd('127.0.0.1', 11300);
client.connect().then(function (client) {
console.log('going to reserve');
client.reserve()
.then(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')
.then((tubecount) => {
console.log(tubecount);
})
.catch(err => {
console.log(err);
})
}, 2000)
setTimeout(function () {
console.log("Hello");
}, 3000);
Output
going to reserve
going to watch
Hello
The text was updated successfully, but these errors were encountered:
apmcodes
changed the title
Watch after Reserv not working
Watch after Reserve not working
Jan 23, 2019
Seems as beanstalkd reserve is blocking call, other commands such as watch/ ignore are hanging. Is there way to watch while the client is still in reserve?
In the below code, first reserve command is run and then watch command after 2 secs, but watch command callback is never run.
Is watch not allowed after reserve, so is the reserve is hanging blocking the connection and no further command is run? Is this the way beanstalkd works or is this this client library ...
Output
The text was updated successfully, but these errors were encountered: