Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SbServer

Hierarchy

  • Server
    • SbServer

Implements

Index

Constructors

constructor

  • Parameters

    • Optional id: string

    Returns SbServer

Properties

client

client: ServiceBusClient

Optional configurator

configurator: SbConfigurator

Optional id

id: string

Accessors

initialized

  • get initialized(): boolean
  • Returns boolean

Methods

addHandler

  • addHandler(pattern: any, handler: MessageHandler): void
  • Parameters

    • pattern: any
    • handler: MessageHandler

    Returns void

close

  • close(): Promise<void>
  • Returns Promise<void>

commitRoutes

  • commitRoutes(): Promise<void>
  • Returns Promise<void>

createRouteContext

destroy

  • destroy(): Promise<void>
  • Returns Promise<void>

getHandlerByPattern

  • getHandlerByPattern(pattern: string): MessageHandler | null
  • Parameters

    • pattern: string

    Returns MessageHandler | null

getHandlers

  • getHandlers(): Map<string, MessageHandler>
  • Returns Map<string, MessageHandler>

getOptionsProp

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

    • T: MicroserviceOptions["options"]

    • K: keyof T

    Parameters

    • obj: T
    • prop: K
    • Optional defaultValue: T[K]

    Returns T[K]

handleEvent

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

    • pattern: string
    • packet: ReadPacket
    • context: BaseRpcContext

    Returns Promise<any>

init

listen

  • listen(callback: () => void): Promise<void>
  • Parameters

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

    Returns Promise<void>

registerRoute

  • registerRoute(type: "pipe", key: string | symbol, subscriber: SbSubscriberMetadata, instanceWrapper: InstanceWrapper<any>, handler: OperatorFunction<SbContext, SbContext>): any
  • registerRoute(type: "method", key: string | symbol, subscriber: SbSubscriberMetadata, instanceWrapper: InstanceWrapper<any>, handler: MessageHandler): any
  • Parameters

    Returns any

  • Parameters

    • type: "method"
    • key: string | symbol
    • subscriber: SbSubscriberMetadata
    • instanceWrapper: InstanceWrapper<any>
    • handler: MessageHandler

    Returns any

send

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

    • stream$: Observable<any>
    • respond: (data: WritePacket) => void
        • (data: WritePacket): void
        • Parameters

          • data: WritePacket

          Returns void

    Returns Subscription

transformToObservable

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

    • T

    Parameters

    • resultOrDeffered: any

    Returns Observable<T>

Generated using TypeDoc