Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerNats

Hierarchy

Implements

  • any

Index

Constructors

constructor

  • Parameters

    • options: object
      • Optional maxReconnectAttempts?: number
      • Optional name?: string
      • Optional pass?: string
      • Optional pedantic?: boolean
      • Optional queue?: string
      • Optional reconnect?: boolean
      • Optional reconnectTimeWait?: number
      • Optional servers?: string[]
      • Optional tls?: any
      • Optional url?: string

    Returns ServerNats

Properties

Protected logger

logger: any = new Logger(Server.name)

Protected messageHandlers

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

Private natsClient

natsClient: Client

Private options

options: object

Type declaration

  • Optional maxReconnectAttempts?: number
  • Optional name?: string
  • Optional pass?: string
  • Optional pedantic?: boolean
  • Optional queue?: string
  • Optional reconnect?: boolean
  • Optional reconnectTimeWait?: number
  • Optional servers?: string[]
  • Optional tls?: any
  • Optional url?: string

Private 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

  • getMessageHandler(channel: string, client: Client): Function

getOptionsProp

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

getPublisher

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

handleError

  • handleError(stream: any): void

handleEvent

  • handleEvent(pattern: string, packet: ReadPacket): Promise<any>

handleMessage

  • handleMessage(channel: string, message: ReadPacket & Partial<PacketId>, client: Client, replyTo: string): Promise<any>

listen

  • listen(callback: function): void

Protected loadPackage

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

send

  • send(stream$: Observable<any>, respond: function): Subscription

start

  • start(callback?: function): void

transformToObservable

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

Generated using TypeDoc