Created
January 4, 2023 11:02
-
-
Save benjaminudoh10/a0d7abc71a450b2f9bf678854787df22 to your computer and use it in GitHub Desktop.
Revisions
-
benjaminudoh10 created this gist
Jan 4, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import { Job } from 'bullmq'; import { JobType, Queues } from '../enum/queue.enum'; import QueueService from '../services/queue.service'; // these enums should be in a separate file and exported enum Queues { DEFAULT = 'default', } enum JobType { PROCESS_PAYMENT = 'process-payment', } export default class DefaultProcessor { static async processPayment(job: Job) { const queue = new QueueService().getQueue(Queues.DEFAULT); if (!queue) return; console.log(`Process job with id ${job.id} from the ${Queues.DEFAULT} queue`); } }