@bitblit/epsilon
Version:
Tiny adapter to simplify building API gateway Lambda APIS
31 lines (30 loc) • 1.57 kB
TypeScript
import { GetQueueAttributesCommandOutput, SQSClient } from '@aws-sdk/client-sqs';
import { BackgroundEntry } from '../background-entry';
import { BackgroundAwsConfig } from '../../config/background/background-aws-config';
import { InternalBackgroundEntry } from '../internal-background-entry';
import { AbstractBackgroundManager } from './abstract-background-manager';
import { SNSClient } from '@aws-sdk/client-sns';
/**
* Handles all submission of work to the background processing system.
*
* Note that this does NOT validate the input, it just passes it along. This is
* because it creates a circular reference to the processors if we try since they
* define the type and validation.
*/
export declare class AwsSqsSnsBackgroundManager extends AbstractBackgroundManager {
private _awsConfig;
private _sqs;
private _sns;
constructor(_awsConfig: BackgroundAwsConfig, _sqs: SQSClient, _sns: SNSClient);
get backgroundManagerName(): string;
get awsConfig(): BackgroundAwsConfig;
get sqs(): SQSClient;
get sns(): SNSClient;
addEntryToQueue<T>(entry: BackgroundEntry<T>, fireStartMessage?: boolean): Promise<string>;
fireImmediateProcessRequest<T>(entry: BackgroundEntry<T>): Promise<string>;
fireStartProcessingRequest(): Promise<string>;
fetchApproximateNumberOfQueueEntries(): Promise<number>;
fetchCurrentQueueAttributes(): Promise<GetQueueAttributesCommandOutput>;
writeMessageToSnsTopic(message: string): Promise<string>;
takeEntryFromBackgroundQueue(): Promise<InternalBackgroundEntry<any>[]>;
}