Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides an interface to create your service and register request handlers.

Hierarchy

  • Service

Index

Constructors

constructor

Properties

Private _codec

_codec: Codec

Private _enableStatusEndpoints

_enableStatusEndpoints: boolean

Private _healthChecks

_healthChecks: object

Type declaration

Private _registerToWatchdog

_registerToWatchdog: boolean

Private _tracer

_tracer: Tracer

Private _transport

_transport: Transport

Private _watchdogServiceName

_watchdogServiceName: string

id

id: string = generateId()

logger

logger: Logger

name

name: string

Protected options

options: Options

Methods

Private _call

Private _checkResponse

  • _checkResponse(res: any): boolean

Private _getCallTimeout

  • _getCallTimeout(path: string, timeout: number): number

Private _handle

Private _serializeRequest

call

Private checkHealthOrTimeout

  • checkHealthOrTimeout(name: string, timeout: number, check: function): Promise<(string | OrionError)[]>

close

  • close(): void

Private commsWithWatchdog

  • commsWithWatchdog(): void

emit

  • emit(topic: string, message: any): void
  • Publish to a topic.

    Parameters

    • topic: string
    • message: any

    Returns void

handle

Private handleHealthCheck

handleWithoutLogging

listen

  • listen(callback?: Function): Promise<any>
  • Start listenning on the underlying transport connection.

    Parameters

    • Optional callback: Function

    Returns Promise<any>

    returns promise if called with no callback.

Private listenToHealthChecks

  • listenToHealthChecks(): void

on

  • on(topic: string, callback: Function, disableGroup?: boolean): any
  • Subscribe to a topic.

    Parameters

    • topic: string
    • callback: Function
    • Default value disableGroup: boolean = false

    Returns any

onAsync

  • onAsync<T>(topic: string, disableGroup?: boolean): AsyncArray<T>
  • Subscribe to a topic, getting a producer/consumer array of promises.

    Type parameters

    • T

    Parameters

    • topic: string
    • Default value disableGroup: boolean = false

    Returns AsyncArray<T>

    An async array following the producer/consumer pattern.

onClose

  • onClose(callback: any): void

registerHealthCheck

toString

  • toString(): string

Generated using TypeDoc