nestjs-google-pubsub-microservice
Version:
NestJS Google Cloud Pub/Sub Microservice Transport
37 lines (36 loc) • 1.74 kB
TypeScript
import { ClientConfig, PubSub, Subscription, Topic, PublishOptions, SubscriberOptions } from '@google-cloud/pubsub';
import { Logger } from '@nestjs/common';
import { ClientProxy, ReadPacket, WritePacket } from '@nestjs/microservices';
import { GCPubSubOptions } from './gc-pubsub.interface';
import { GCPubSubEvents } from './gc-pubsub.events';
export declare class GCPubSubClient extends ClientProxy<GCPubSubEvents> {
protected readonly options: GCPubSubOptions;
protected readonly logger: Logger;
protected readonly topicName: string;
protected readonly publisherConfig: PublishOptions;
protected readonly replyTopicName?: string;
protected readonly replySubscriptionName?: string;
protected readonly clientConfig: ClientConfig;
protected readonly subscriberConfig: SubscriberOptions;
protected readonly noAck: boolean;
protected readonly useAttributes: boolean;
protected client: PubSub | null;
protected replySubscription: Subscription | null;
protected topic: Topic | null;
protected init: boolean;
protected readonly scopedEnvKey: string | null;
protected readonly checkExistence: boolean;
protected readonly replySubscriptionFilter: string | undefined;
constructor(options: GCPubSubOptions);
close(): Promise<void>;
connect(): Promise<PubSub>;
createClient(): PubSub;
protected dispatchEvent(packet: ReadPacket): Promise<any>;
protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => void): () => boolean;
handleResponse(message: {
data: Buffer;
attributes: Record<string, string>;
}): Promise<boolean>;
createIfNotExists(create: () => Promise<any>): Promise<void>;
unwrap<T>(): T;
}