Version: Next

Interfaces

A common directory for all the interfaces used by this package.

Job Options

interface JobOptions {
delay?: number;
tries?: number;
queue?: string;
timeout?: number;
connection?: string;
}

Payload

type Payload = Record<string, any> | string | number;

Message

interface Message extends JobOptions {
job: string;
data: Payload | Payload[];
}

SqsBrokerOption

interface SqsBrokerOption {
driver: "sqs";
profile: string;
apiVersion: string;
prefix: string;
queue: string;
suffix?: string;
region: string;
}

QueueOption

interface QueueOptions {
isGlobal?: boolean;
default: string;
connections: {
[key: string]: SqsBrokerOption;
};
}

QueueAsyncOptionsFactory

interface QueueAsyncOptionsFactory {
createQueueOptions(): Promise<QueueOptions> | QueueOptions;
}

QueueAsyncOptions

interface QueueAsyncOptions extends Pick<ModuleMetadata, "imports"> {
name?: string;
isGlobal: boolean;
useExisting?: Type<QueueOptions>;
useClass?: Type<QueueAsyncOptionsFactory>;
useFactory?: (...args: any[]) => Promise<QueueOptions> | QueueOptions;
inject?: any[];
}

ListenerOptions

interface ListenerOptions {
sleep?: number;
connection?: string;
queue?: string;
}