OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Where "added" event :?

koplenov opened this issue · comments

Description

https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#events

I lack the functionality to generate reports from data - data sampling

I am trying to make a metadata layer in sqlite:

const queue_bull = require("bull");

let queue = new queue_bull("llama")
queue.on('global:removed', function (job) {
   // A job successfully removed.
   console.error({global_removed: job})
   // ===> sqlite delete metadata for this job
});

const original_add = queue.add
queue.add = async function() {
   // extract some index filed for insert it into sqlite
   const {token, batch_id = "", sort_index, stage} = arguments[0]

   // Invoke the original method with an additional parameter
   const job = await original_add.apply(queue, arguments);

   // ===> sqlite insert metatada for optimized search
};
	

This will allow me to just do a selection of work results

I'm missing the "added" event to simplify the implementation

Can we add it?

Bull version

^4.11.3

I think bulljs + sqlite = silver bullet

We are not adding more features to Bull. In BullMQ there is already an "added" event though: https://api.docs.bullmq.io/interfaces/v5.QueueEventsListener.html#added
Note that in BullMQ you do not need to use "global:" as prefix, but you must use the QueueEvents class.