admin管理员组文章数量:1301611
Is it possible to use Bull (for job management) without using Redis?
My code:
@Injectable()
export class MailService {
private queue: Bull.Queue;
private readonly queueName = 'mail';
constructor() {
this.queue = new Bull(this.queueName)
}
addTaskToQueue() {
this.queue.process('send_mail',
async (job: Bull.Job, done: Bull.DoneCallback) => {
console.log('Send mail!');
console.log(JSON.stringify(job.data));
done();
})
}
async send(year: number, month: number) {
try{
await this.queue.add('send_mail', {
year,
month
});
console.log('done');
} catch(err){
console.log(err);
}
}
}
Upon running, my console trew this error:
{ Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as onplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379 }
Is it possible to use Bull (for job management) without using Redis?
My code:
@Injectable()
export class MailService {
private queue: Bull.Queue;
private readonly queueName = 'mail';
constructor() {
this.queue = new Bull(this.queueName)
}
addTaskToQueue() {
this.queue.process('send_mail',
async (job: Bull.Job, done: Bull.DoneCallback) => {
console.log('Send mail!');
console.log(JSON.stringify(job.data));
done();
})
}
async send(year: number, month: number) {
try{
await this.queue.add('send_mail', {
year,
month
});
console.log('done');
} catch(err){
console.log(err);
}
}
}
Upon running, my console trew this error:
{ Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as onplete] (net.js:1107:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379 }
Share
edited Jul 29, 2022 at 21:27
ggorlen
57.4k8 gold badges110 silver badges154 bronze badges
asked Jul 14, 2020 at 17:57
user13459552user13459552
1 Answer
Reset to default 8Bull is built on top of Redis, that's its backend. You can't use it without Redis. You could probably implement some sort of custom system that doesn't require something like Redis using RxJS and some state management, but Bull must have Redis.
本文标签: javascriptBull without Redis for queue managementStack Overflow
版权声明:本文标题:javascript - Bull without Redis for queue management - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741667623a2391407.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论