@nestjstools/messaging-google-pubsub-extension
Version:
Extension to handle messages and dispatch them over Google PubSub
20 lines • 690 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GooglePubSubChannel = void 0;
const messaging_1 = require("@nestjstools/messaging");
const pubsub_1 = require("@google-cloud/pubsub");
class GooglePubSubChannel extends messaging_1.Channel {
pubSubManager;
constructor(config) {
super(config);
this.pubSubManager = new pubsub_1.PubSub({
projectId: config.credentials?.projectId,
});
}
async onChannelDestroy() {
await this.pubSubManager.close();
return super.onChannelDestroy();
}
}
exports.GooglePubSubChannel = GooglePubSubChannel;
//# sourceMappingURL=google-pub-sub.channel.js.map