feat(microservices): Add ability for pass transport to MessagePattern

This commit is contained in:
alex
2020-05-10 01:50:05 +03:00
parent bb71ceaf3d
commit 0845dab3a3
15 changed files with 88 additions and 27 deletions

View File

@@ -21,6 +21,7 @@ import {
} from '../interfaces';
import { TcpOptions } from '../interfaces/microservice-configuration.interface';
import { Server } from './server';
import { Transport } from '../enums';
export class ServerTCP extends Server implements CustomTransportStrategy {
private readonly port: number;
@@ -40,6 +41,10 @@ export class ServerTCP extends Server implements CustomTransportStrategy {
this.initializeDeserializer(options);
}
public getTransport(): number {
return Transport.TCP;
}
public listen(callback: () => void) {
this.server.listen(this.port, this.host, callback);
}