@ecobee/nodejs-gcloud-pubsub-module
Version:
A GCloud Pub/Sub module for NestJS
15 lines (14 loc) • 754 B
TypeScript
import { PubSub, Subscription, Message } from '@google-cloud/pubsub';
import { Server, CustomTransportStrategy } from '@nestjs/microservices';
import { GCloudPubSubServerOptions } from '../interfaces/gcloud-pub-sub.interface';
export declare class GCloudPubSubServer extends Server implements CustomTransportStrategy {
readonly options: GCloudPubSubServerOptions;
client: PubSub;
subscriptions: Subscription[];
isShuttingDown: boolean;
constructor(options: GCloudPubSubServerOptions);
listen(callback: () => void): void;
handleErrorFactory(subscription: Subscription, subcriptionName: string): (error: any) => void;
close(): void;
handleMessageFactory(subscriptionName: string): (message: Message) => Promise<void>;
}