inceptum
Version:
hipages take on the foundational library for enterprise-grade apps written in NodeJS
39 lines (38 loc) • 1.13 kB
TypeScript
import * as SqsConsumer from 'sqs-consumer';
export interface SqsWorkerConfigObject {
/**
* The queueUrl you are connecting to. (Default: localhost)
*/
queueUrl?: string;
region?: string;
attributeNames?: Array<string>;
handleMessage?: Function;
batchSize?: number;
/**
* The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds)
*/
connectTimeout?: number;
}
export declare abstract class SqsHandler {
/**
*
* @param message
* @param done
*/
abstract handle(message: Object, done: (err?: Error) => void): any;
}
export declare class SqsWorker {
static startMethod: string;
static stopMethod: string;
static lazy: boolean;
readonly maxRetries: number;
configuration: SqsWorkerConfigObject;
name: string;
consumerCreator: (config: SqsWorkerConfigObject) => SqsConsumer;
instance: SqsConsumer;
handler: SqsHandler;
constructor(configuration: SqsWorkerConfigObject, name: string);
initialise(): void;
shutdown(): void;
getMaxRetries(): number;
}