Some checks failed
ci/woodpecker/push/ci Pipeline failed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
628 B
TypeScript
22 lines
628 B
TypeScript
import { Global, Module } from '@nestjs/common';
|
|
import { createQueueAdapter, type QueueAdapter } from '@mosaic/queue';
|
|
import type { MosaicConfig } from '@mosaic/config';
|
|
import { MOSAIC_CONFIG } from '../config/config.module.js';
|
|
import { QueueService } from './queue.service.js';
|
|
|
|
export const QUEUE_ADAPTER = 'QUEUE_ADAPTER';
|
|
|
|
@Global()
|
|
@Module({
|
|
providers: [
|
|
QueueService,
|
|
{
|
|
provide: QUEUE_ADAPTER,
|
|
useFactory: (config: MosaicConfig): QueueAdapter => createQueueAdapter(config.queue),
|
|
inject: [MOSAIC_CONFIG],
|
|
},
|
|
],
|
|
exports: [QueueService, QUEUE_ADAPTER],
|
|
})
|
|
export class QueueModule {}
|