Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerNats

Hierarchy

Implements

Index

Constructors

constructor

  • new ServerNats(options: NatsOptions["options"]): ServerNats

Properties

Protected deserializer

deserializer: ConsumerDeserializer

Protected Readonly logger

logger: Logger = new Logger(Server.name)

Protected Readonly messageHandlers

messageHandlers: Map<string, MessageHandler<any, any, any>> = new Map<string, MessageHandler>()

Private natsClient

natsClient: Client

Private Readonly options

options: NatsOptions["options"]

Protected serializer

serializer: ConsumerSerializer

Readonly transportId

transportId: NATS = Transport.NATS

Private Readonly url

url: string

Methods

addHandler

  • addHandler(pattern: any, callback: MessageHandler, isEventHandler?: boolean): void

bindEvents

  • bindEvents(client: Client): void

close

  • close(): void

createNatsClient

getHandlerByPattern

getHandlers

getMessageHandler

getOptionsProp

  • getOptionsProp<T, K>(obj: T, prop: K, defaultValue?: T[K]): T[K]

getPublisher

  • getPublisher(publisher: Client, replyTo: string, id: string): (Anonymous function) | (Anonymous function)

Protected getRouteFromPattern

  • getRouteFromPattern(pattern: string): string

handleError

  • handleError(stream: any): void

handleEvent

handleMessage

  • handleMessage(channel: string, rawMessage: any, client: Client, replyTo: string, callerSubject: string): Promise<any>

Protected initializeDeserializer

  • initializeDeserializer(options: ClientOptions["options"]): void

Protected initializeSerializer

  • initializeSerializer(options: ClientOptions["options"]): void

listen

  • listen(callback: () => void): void

Protected loadPackage

  • loadPackage<T>(name: string, ctx: string, loader?: Function): T

Protected normalizePattern

  • normalizePattern(pattern: MsPattern): string

send

  • send(stream$: Observable<any>, respond: (data: WritePacket) => void): Subscription

start

  • start(callback?: () => void): void

transformToObservable

  • transformToObservable<T>(resultOrDeferred: any): Observable<T>

Generated using TypeDoc