import { Module, Global } from "@nestjs/common";
import { BullMqService } from "./bullmq.service";

/**
 * BullMqModule - Job queue module using BullMQ with Valkey backend
 *
 * This module provides job queue functionality for the Mosaic Component Architecture.
 * It creates and manages queues for different agent profiles:
 * - mosaic-jobs (main queue)
 * - mosaic-jobs-runner (read-only operations)
 * - mosaic-jobs-weaver (write operations)
 * - mosaic-jobs-inspector (validation operations)
 *
 * Shares the same Valkey connection used by ValkeyService (VALKEY_URL env var).
 *
 * Marked as @Global to allow injection across the application without explicit imports.
 */
@Global()
@Module({
  providers: [BullMqService],
  exports: [BullMqService],
})
export class BullMqModule {}
