mubashir
mubashir

Reputation: 811

onQueueAdded event in nestjs for bull mq

I want to perform some action when a job is added into the queue. I have studied nestjs documentation for queues but didn't find any event decorator that handles add events (something like onQueueAdded). Whereas other events are available like @OnQueueWaiting and onQueueCompleted. When I checked bullmq documentation I found added event. How can I use this in nestjs?

Bullmq add event: https://api.docs.bullmq.io/interfaces/v5.QueueEventsListener.html#added

Example:

@OnQueueCompleted()
async onJobCompleted(job: Job<any>){
  // Add code here on job complete
}

Upvotes: 0

Views: 157

Answers (0)

Related Questions