Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const microservices_1 = require("@nestjs/microservices");
const rxjs_1 = require("rxjs");
const errors_1 = require("../errors");
class GrpcMicroservice extends microservices_1.Server {
constructor(server, config) {
super();
this.server = server;
this.host = config.host;
this.port = config.port;
this.serviceName = config.serviceName;
}
listen(callback) {
this.init();
this.server.start(`${this.host}:${this.port}`);
callback && callback();
}
close() {
this.server && this.server.forceShutdown();
}
init() {