Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IEventClient

Event Client Interface

Used for communicating with Queueing systems, such as AMQP and MQTT

export
interface

IEventClient

Hierarchy

  • IEventClient

Implemented by

Index

Methods

dispose

  • dispose(): Promise<void>
  • Cleanup, important in order to prevent connection and memory leaks

    Returns Promise<void>

onError

  • onError(errorHandler: (err: Error) => void): Promise<void>
  • Subscribes to Errors

    memberof

    IEventClient

    Parameters

    • errorHandler: (err: Error) => void
        • Parameters

          Returns void

    Returns Promise<void>

publish

  • publish<T>(topic: string, message: T): Promise<void>
  • Publishes a message to a topic/queue

    template

    T

    memberof

    IEventClient

    Type parameters

    • T

    Parameters

    • topic: string

      topic or queue to send the message to

    • message: T

      the message could be either object or otherwise

    Returns Promise<void>

subscribe

  • subscribe<T>(topic: string, callback: (message: T) => void): Promise<void>
  • Subscribes to a topic/queue with callback for incoming messages

    template

    T

    memberof

    IEventClient

    Type parameters

    • T

    Parameters

    • topic: string

      topic or queue to subscribe to

    • callback: (message: T) => void

      callback that will be called for each incoming message

        • (message: T): void
        • Parameters

          • message: T

          Returns void

    Returns Promise<void>

waitForReady

  • waitForReady(): Promise<boolean>
  • Waits for the Transport to be ready

    memberof

    HTTPTransport

    Returns Promise<boolean>

Generated using TypeDoc