2021-09-07 20:06:20 +02:00
|
|
|
const { processEvent } = require("./utils")
|
2021-09-08 20:29:28 +02:00
|
|
|
const { queue } = require("./bullboard")
|
2020-10-07 18:56:47 +02:00
|
|
|
|
2020-09-11 19:47:22 +02:00
|
|
|
/**
|
|
|
|
* This module is built purely to kick off the worker farm and manage the inputs/outputs
|
|
|
|
*/
|
2021-09-08 20:29:28 +02:00
|
|
|
exports.init = function () {
|
|
|
|
// this promise will not complete
|
|
|
|
return queue.process(async job => {
|
2021-09-07 20:06:20 +02:00
|
|
|
await processEvent(job)
|
2020-09-10 16:00:21 +02:00
|
|
|
})
|
|
|
|
}
|
2021-09-08 20:29:28 +02:00
|
|
|
|
|
|
|
exports.getQueues = () => {
|
|
|
|
return [queue]
|
|
|
|
}
|
|
|
|
exports.queue = queue
|