anchan828 / nest-cloud-run-queue

Create a Queue/Worker for NestJS application in Cloud Run.
MIT License
36 stars 1 forks source link

feat: add getAllWorkers method #1956

Closed anchan828 closed 1 week ago

anchan828 commented 1 week ago

1951

async function bootstrap(): Promise<void> {
  const app = await NestFactory.create(WorkerAppModule);
  const service = app.get(QueueWorkerService);
  const allWorkers = service.getAllWorkers();
  const allProcessors = allWorkers.flatMap(w => w.processors);

  // Do somethings...
}