2021-09-08 06:06:20 +12:00
|
|
|
const { processEvent } = require("./utils")
|
2022-05-31 08:22:06 +12:00
|
|
|
const { queue, shutdown } = require("./bullboard")
|
2022-04-06 23:34:31 +12:00
|
|
|
const { TRIGGER_DEFINITIONS } = require("./triggers")
|
|
|
|
const { ACTION_DEFINITIONS } = require("./actions")
|
2020-10-08 05:56:47 +13:00
|
|
|
|
2020-09-12 05:47:22 +12:00
|
|
|
/**
|
|
|
|
* This module is built purely to kick off the worker farm and manage the inputs/outputs
|
|
|
|
*/
|
2021-09-09 06:29:28 +12:00
|
|
|
exports.init = function () {
|
|
|
|
// this promise will not complete
|
|
|
|
return queue.process(async job => {
|
2021-09-08 06:06:20 +12:00
|
|
|
await processEvent(job)
|
2020-09-11 02:00:21 +12:00
|
|
|
})
|
|
|
|
}
|
2021-09-09 06:29:28 +12:00
|
|
|
|
|
|
|
exports.getQueues = () => {
|
|
|
|
return [queue]
|
|
|
|
}
|
2022-04-06 23:34:31 +12:00
|
|
|
|
2022-05-31 08:22:06 +12:00
|
|
|
exports.shutdown = () => {
|
|
|
|
return shutdown()
|
|
|
|
}
|
|
|
|
|
2021-09-09 06:29:28 +12:00
|
|
|
exports.queue = queue
|
2022-04-06 23:34:31 +12:00
|
|
|
exports.TRIGGER_DEFINITIONS = TRIGGER_DEFINITIONS
|
|
|
|
exports.ACTION_DEFINITIONS = ACTION_DEFINITIONS
|