This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
Releases: anchan828/nest-bull
Releases · anchan828/nest-bull
v3.1.0
v3.0.0
v1.1.0
@anchan828/nest-bullmq
BullQueueEventProcess deprecated
Use BullQueueListener, BullWorkerListener and BullQueueEventsListener instead.
Add Worker/Queue/QueueEvents listener decorators
Add dedicated listener decorators for more clarity.
Worker listeners
All event names can be found here.
import { BullWorker, BullWorkerProcess, BullWorkerListener, BullWorkerListenerArgs } from "@anchan828/nest-bullmq";
import { APP_QUEUE } from "./app.constants";
@BullWorker({ queueName: APP_QUEUE })
export class ExampleBullWorker {
@BullWorkerProcess()
public async process(job: Job): Promise<{ status: string }> {
return { status: "ok" };
}
@BullWorkerListener("completed")
public async completed(job: BullWorkerListenerArgs["completed"]): Promise<void> {
calledEvents("completed");
console.debug(`[${job.id}] completed`);
}
}
Queue listeners
All event names can be found here.
import { BullQueue, BullQueueListener, BullQueueListenerArgs } from "@anchan828/nest-bullmq";
import { APP_QUEUE } from "./app.constants";
@BullQueue({ queueName: APP_QUEUE })
export class ExampleBullQueue {
@BullQueueListener("waiting")
public async waiting(job: BullQueueListenerArgs["waiting"]): Promise<void> {
calledEvents("waiting");
console.debug(`[${job.id}] waiting`);
}
}
QueueEvents listeners
All event names can be found here.
import { BullQueueEvents, BullQueueEventsListener, BullQueueEventsListenerArgs } from "@anchan828/nest-bullmq";
import { APP_QUEUE } from "./app.constants";
@BullQueueEvents({ queueName: APP_QUEUE })
export class ExampleBullQueueEvents {
@BullQueueEventsListener("added")
public async added(args: BullQueueEventsListenerArgs["added"]): Promise<void> {
console.debug(`[${args.jobId}] added`);
}
@BullQueueEventsListener("active")
public async active(args: BullQueueEventsListenerArgs["active"]): Promise<void> {
console.debug(`[${args.jobId}] active`);
}
@BullQueueEventsListener("completed")
public async completed(args: BullQueueEventsListenerArgs["completed"]): Promise<void> {
console.debug(`[${args.jobId}] completed`);
}
@BullQueueEventsListener("waiting")
public async waiting(args: BullQueueEventsListenerArgs["waiting"]): Promise<void> {
console.debug(`[${args.jobId}] waiting`);
}
}
v1.0.0
v0.5.0
- terminus packages
- drop @godaddy/terminus
- adopted the newest way.
Please create controller for checking helth.
@Controller("/health")
class BullHealthController {
constructor(private health: HealthCheckService, private bull: BullHealthIndicator) {}
@Get()
@HealthCheck()
check() {
return this.health.check([() => this.bull.isHealthy()]);
}
}