Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerRedis

Hierarchy

Implements

Index

Constructors

constructor

  • new ServerRedis(options: RedisOptions["options"]): ServerRedis

Properties

Protected deserializer

deserializer: ConsumerDeserializer

Private isExplicitlyTerminated

isExplicitlyTerminated: boolean = false

Protected Readonly logger

logger: Logger = new Logger(Server.name)

Protected Readonly messageHandlers

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

Private Readonly options

options: RedisOptions["options"]

Private pubClient

pubClient: RedisClient

Protected serializer

serializer: ConsumerSerializer

Private subClient

subClient: RedisClient

Readonly transportId

transportId: REDIS = Transport.REDIS

Private Readonly url

url: string

Methods

addHandler

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

bindEvents

close

  • close(): void

createRedisClient

createRetryStrategy

getClientOptions

getHandlerByPattern

getHandlers

getMessageHandler

  • getMessageHandler(pub: RedisClient): (Anonymous function)

getOptionsProp

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

getPublisher

  • getPublisher(pub: RedisClient, pattern: any, id: string): (Anonymous function)

getReplyPattern

  • getReplyPattern(pattern: string): string

getRequestPattern

  • getRequestPattern(pattern: string): string

Protected getRouteFromPattern

  • getRouteFromPattern(pattern: string): string

handleError

  • handleError(stream: any): void

handleEvent

handleMessage

  • handleMessage(channel: string, buffer: string | any, pub: RedisClient): 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

parseMessage

  • parseMessage(content: any): Record<string, any>

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