How to use the @nestjs/microservices.Server function in @nestjs/microservices

To help you get started, weโ€™ve selected a few @nestjs/microservices examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github notadd / next / packages / rpc / microservices / grpc.microservice.js View on Github external
"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() {