refactor(microservices) remove unecessary options object

This commit is contained in:
Kamil Myśliwiec
2018-09-02 22:31:11 +02:00
parent fde2041f17
commit b6fe9b06cc
23 changed files with 167 additions and 61 deletions

View File

@@ -2,9 +2,18 @@ import * as JsonSocket from 'json-socket';
import * as net from 'net';
import { Server as NetSocket } from 'net';
import { Observable } from 'rxjs';
import { CLOSE_EVENT, ERROR_EVENT, MESSAGE_EVENT, NO_PATTERN_MESSAGE, TCP_DEFAULT_PORT } from '../constants';
import {
CLOSE_EVENT,
ERROR_EVENT,
MESSAGE_EVENT,
NO_PATTERN_MESSAGE,
TCP_DEFAULT_PORT,
} from '../constants';
import { CustomTransportStrategy, PacketId, ReadPacket } from '../interfaces';
import { MicroserviceOptions, TcpOptions } from '../interfaces/microservice-configuration.interface';
import {
MicroserviceOptions,
TcpOptions,
} from '../interfaces/microservice-configuration.interface';
import { Server } from './server';
export class ServerTCP extends Server implements CustomTransportStrategy {
@@ -13,7 +22,7 @@ export class ServerTCP extends Server implements CustomTransportStrategy {
private isExplicitlyTerminated = false;
private retryAttemptsCount = 0;
constructor(private readonly options: MicroserviceOptions) {
constructor(private readonly options: MicroserviceOptions['options']) {
super();
this.port =
this.getOptionsProp<TcpOptions>(options, 'port') || TCP_DEFAULT_PORT;