+1
-9
@@ -17,18 +17,10 @@ export interface MessageQueueProcessorOptions {
|
||||
scope?: Scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a worker that is able to process jobs from the queue.
|
||||
* @param queueName name of the queue to process
|
||||
*/
|
||||
export function Processor(queueName: MessageQueue): ClassDecorator;
|
||||
/**
|
||||
* Represents a worker that is able to process jobs from the queue.
|
||||
* @param processorOptions processor options
|
||||
*/
|
||||
export function Processor(
|
||||
processorOptions: MessageQueueProcessorOptions,
|
||||
): ClassDecorator;
|
||||
export function Processor(
|
||||
queueNameOrOptions: string | MessageQueueProcessorOptions,
|
||||
): ClassDecorator {
|
||||
@@ -37,7 +29,7 @@ export function Processor(
|
||||
? queueNameOrOptions
|
||||
: { queueName: queueNameOrOptions };
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
||||
|
||||
return (target: Function) => {
|
||||
SetMetadata(SCOPE_OPTIONS_METADATA, options)(target);
|
||||
SetMetadata(PROCESSOR_METADATA, options)(target);
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
||||
|
||||
import { Injectable, type Type } from '@nestjs/common';
|
||||
import { Reflector } from '@nestjs/core';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user