add message queue integration (#2491)

This commit is contained in:
Mahendra Kumar
2023-12-01 12:09:04 -03:00
committed by GitHub
parent 93e4f79551
commit f405b77cea
18 changed files with 796 additions and 181 deletions

View File

@ -0,0 +1,27 @@
import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
import { MessageQueueType } from 'src/integrations/environment/interfaces/message-queue.interface';
import { BullMQDriverOptions } from 'src/integrations/message-queue/drivers/bullmq.driver';
import { PgBossDriverOptions } from 'src/integrations/message-queue/drivers/pg-boss.driver';
export interface PgBossDriverFactoryOptions {
type: MessageQueueType.PgBoss;
options: PgBossDriverOptions;
}
export interface BullMQDriverFactoryOptions {
type: MessageQueueType.BullMQ;
options: BullMQDriverOptions;
}
export type MessageQueueModuleOptions =
| PgBossDriverFactoryOptions
| BullMQDriverFactoryOptions;
export type MessageQueueModuleAsyncOptions = {
useFactory: (
...args: any[]
) => MessageQueueModuleOptions | Promise<MessageQueueModuleOptions>;
} & Pick<ModuleMetadata, 'imports'> &
Pick<FactoryProvider, 'inject'>;