feat(microservices): move getTransportId functions to public variable transportId and make it optional

This commit is contained in:
alex
2020-05-16 15:22:15 +03:00
parent 0845dab3a3
commit e2c8f74f19
13 changed files with 16 additions and 37 deletions

View File

@@ -19,6 +19,7 @@ let natsPackage: any = {};
export class ServerNats extends Server implements CustomTransportStrategy {
private readonly url: string;
private natsClient: Client;
public readonly transportId: Transport = Transport.NATS;
constructor(private readonly options: NatsOptions['options']) {
super();
@@ -32,10 +33,6 @@ export class ServerNats extends Server implements CustomTransportStrategy {
this.initializeDeserializer(options);
}
public getTransport(): number {
return Transport.NATS;
}
public listen(callback: () => void) {
this.natsClient = this.createNatsClient();
this.handleError(this.natsClient);