mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feat(microservices): Add ability for pass transport to MessagePattern
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user