Burstable
Simple and powerful task queue for Node.js on top of Beanstalkd
Features
- Wait for job completion
- Child jobs (keeping parent alive till done)
How-To
Setup
import Burstable from 'burstable';
const burstable = new Burstable(
host,
port,
{
}
);
Spawning jobs
burstable.spawn(tube, {
delay: 0,
priority: 1000,
timeout: 10 * 60 * 1000,
payload: {
},
wait: Job | [Job...] | [{tube: String, id: Number}]
});
Handling jobs
burstable.handle(tube, function (payload) {
return Promise.resolve();
return Promise.reject();
return this.child(anotherTube);
}, {
maxTries: 3,
backoff: {
initial: 60 * 1000,
exponential: 1.5
}
});
burstable.start();
Debugging
Use DEBUG=burstable*
to enable verbose debugging.