Skip to content

microservice-job-broker


Class: ExecutableStorageService

Defined in: packages/microservice/job-broker/src/executable/services/executable-storage.service.ts:18

Service for storing executed task results in a database. This service connects to RabbitMQ to consume task results and saves them to a MongoDB collection.

Implements

  • OnApplicationBootstrap

Constructors

Constructor

new ExecutableStorageService(executableJobModel, configSvc): ExecutableStorageService

Defined in: packages/microservice/job-broker/src/executable/services/executable-storage.service.ts:25

Construct the service with persistence and configuration dependencies.

Parameters

executableJobModel

Model<ExecutableJobReport>

Mongoose model used to persist executed task results

configSvc

ConfigService

Nest ConfigService for RabbitMQ URLs and queue settings

Returns

ExecutableStorageService

Methods

getExecutedTasks()

getExecutedTasks(): Promise<ExecutableJobReport[]>

Defined in: packages/microservice/job-broker/src/executable/services/executable-storage.service.ts:156

Retrieves all executed tasks from the database.

Returns

Promise<ExecutableJobReport[]>

A promise that resolves to an array of executed results.


onApplicationBootstrap()

onApplicationBootstrap(): Promise<void>

Defined in: packages/microservice/job-broker/src/executable/services/executable-storage.service.ts:64

This method is automatically called when the application is bootstrapped and sets up the RabbitMQ connection and starts consuming task results.

Returns

Promise<void>

Implementation of

OnApplicationBootstrap.onApplicationBootstrap